Coding/scripting is something we often vastly depend on to enhance and customize our forum. Although codes can be very useful, there is always some guidelines you may want to follow to optimize your coding for better performance, so I will go over some of these.
Hosting Scripts Externally
Hosting scripts externally can help your codes load faster because they will be cached by the browser for quicker load times. You can easily host a script externally in a text editor like Notepad. JavaScript external files end with the .js extension.
Minimizing Scripts
Minimizing scripts essentially takes all white space out of the script to minimize the file size of your JavaScript or overall page. When minimizing scripts you want to make sure your coding is 100% validated because it compresses the script all on one line basically, making it where even one missing semicolon could break your script. There are various compression tools for coding on the web.
Validating Scripts
Validating scripts is the process of making sure your script has no errors so it can function properly and not break the code or other codes. You can validate scripts with a tool such as JSHint or use the web developer tools console that is generally accessed via right-click on a webpage.
Minimize AJAX Requests
AJAX fetches data from one page or an external resource to your board. AJAX requests can often have an impact on the performance of your board. While it’s not necessarily a bad thing to use, keeping it to a minimum is a good thing to do.
Minimize Scripts Altogether
Although graphics generally take up more file space on your board than scripts, you don’t want to bloat your board with endless scripts that could affect the performance of your board. Try and use what scripts are necessary and try and do away with scripts that are not necessarily needed.
Hosting Scripts on Your Forum
If hosting JavaScript is an option on your forum, you probably want to host it on your board rather than an external host so it will always be up and running when your board is up and online.
Hosting Scripts Externally
Hosting scripts externally can help your codes load faster because they will be cached by the browser for quicker load times. You can easily host a script externally in a text editor like Notepad. JavaScript external files end with the .js extension.
Minimizing Scripts
Minimizing scripts essentially takes all white space out of the script to minimize the file size of your JavaScript or overall page. When minimizing scripts you want to make sure your coding is 100% validated because it compresses the script all on one line basically, making it where even one missing semicolon could break your script. There are various compression tools for coding on the web.
Validating Scripts
Validating scripts is the process of making sure your script has no errors so it can function properly and not break the code or other codes. You can validate scripts with a tool such as JSHint or use the web developer tools console that is generally accessed via right-click on a webpage.
Minimize AJAX Requests
AJAX fetches data from one page or an external resource to your board. AJAX requests can often have an impact on the performance of your board. While it’s not necessarily a bad thing to use, keeping it to a minimum is a good thing to do.
Minimize Scripts Altogether
Although graphics generally take up more file space on your board than scripts, you don’t want to bloat your board with endless scripts that could affect the performance of your board. Try and use what scripts are necessary and try and do away with scripts that are not necessarily needed.
Hosting Scripts on Your Forum
If hosting JavaScript is an option on your forum, you probably want to host it on your board rather than an external host so it will always be up and running when your board is up and online.