Welcome Guest, Not a member yet? Register   Sign In
calling external js files
#3

[eluser]Craig A Rodway[/eluser]
Including CSS and Javascript code is more efficient in the long run than having it all embedded in pages - from developer perspective and also the user.

Firstly, you can modularise CSS and JS and, with some PHP magic, only include the desired scripts as and when you need them. Secondly and probably more importantly, browsers usually cache included files. So your 10KB+ of CSS/JS is cached instead of being downloaded on EVERY page view if you wrote it embedded in your page.

The less the browser has to download, the better - the overhead of making separate requests isn't usually that much compared to the size of the file downloaded so don't worry about that.


Messages In This Thread
calling external js files - by El Forum - 01-08-2008, 10:31 AM
calling external js files - by El Forum - 01-08-2008, 11:07 AM
calling external js files - by El Forum - 01-08-2008, 11:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB