July 4, 201313 yr I wanted to know how i use java script so that they not affect the loading time of website. My website takes long time to loading. And I think this because of java script.
July 4, 201313 yr I wanted to know how i use java script so that they not affect the loading time of website. My website takes long time to loading. And I think this because of java script. This could be the case, could be something else. Give us a link to the site and we'll check it out.
July 5, 201313 yr Here's a few general tips to speed up js. 1. If you are loading external libraries link to a CDN if possible instead of loading the files from your own server. 2. Replace global variables with local vars when they are only used by one function. 3. If you are targeting the same DOM elements often, store them in a global/shared variable. 4. If you are changing style propperties with js change the classname propperty to an existing css class instead of changing the style propperty itself. 5. Remove all whitespace in your js files and compress them.
July 5, 201313 yr If your javascripts must be affected after the loading of your website, please put those after yout </body> tag. That will be help you regarding this..
Create an account or sign in to comment