Is it always safe to concatenate javascript files from different sources and load them as one? -


I want to serve them as one from my site - so that my code is jquery plugins or other third party scripts . (I'm using Google CDN to host jQuery).

I was thinking that it is a safe thing to guarantee always . I'm not an expert in javascript as far as the namespace goes on and I was just a little worried that it is possible that something like this can be done - like building a name space that could be the reason for conflict, I believe it is okay I know JavaScript is well made from all sources

As far as I know & lt; Script & gt; The tag essentially just puts JS at the place as it was in the file, but I wonder if this is not true in case of a border.

I know that there is something in common to add files that is normal and used by the JavaScript framework - but obviously they have complete control over their files.

You can come in syntax errors around semi-colon.

File A:

  var foo = 3 // File End  

File B:

   / Pre> 

Easily solved by a half-colon grip between each file that you are conveying.


Comments