I just want to know if the following sequence of javascript code is possible.If possible what are the drawbacks and what are the considerations I should remember. <script type="text/javascript" src="someFile.js"></script> <script type="text/javascript"> // code goes here </script> <script type="text/javascript" src="anotherFile.js"></script> <script type="text/javascript" src="anotherFile.js"></script> <script type="text/javascript"> // code goes here </script> Code (markup):
might be a little bit slower with multiple javascript files but not significantly, plus seperating the code into seperate files will make debugging slighly easier if you don't have a proper debugger.
just remember this though: # Inline scripts block rendering in the entire page; # Inline scripts block downloads; # Stylesheets followed by inline scripts can make your pages twice as slow; (championed by Steve Souders (author of YSlow), who now works at google on web performance).