i know there's a limit to the number of style sheets a webpage can have, but what about attached javascript files?

StackOverflow https://stackoverflow.com/questions/4158982

  •  08-10-2019
  •  | 
  •  

Question

IE has a limit of 31 style sheets (there are ways around that) but is there a limit to how many javascript files i can include? if i go above it, what happens?

i've got a page now with 40+ included js files.

Was it helpful?

Solution

Due respect, I think you're asking the wrong question. The correct question is: "I have 40+ JS include files...how do I fix it?"

Check out Google's article on reducing http round-trips, and the benefits of doing so. Combine, minify and deliver your files via gzip whenever possible.

The page not working is one concern, and a valid one...but why not side-step it and greatly improve your users' load time while you're at it by combining and minifying those files now, before you approach any limit? For mobile users round-trips are especially painful, but there's no reason not to offer a more optimal load experience to all your users.

OTHER TIPS

I tried it myself and can now say that you can safely import and execute at least 200 JavaScript files in your HTML via script tag with the src-attribue with the following browsers:

  • Win XP IE6,
  • Win XP IE7,
  • Win XP IE8,
  • Windows 7 IE9,
  • Mac OS X Lion Chrome 21,
  • Mac OS X Lion Firefox 15,
  • Mac OS X Lion Opera 12,
  • Mac OS X Lion Safari 6.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top