I admit, I don’t know too much about javascript, mostly I just ‘steal and modify’ from Javascript.com and Dynamic Drive.
I’ve run across a few scripts that call two .js files
<script type='text/javascript' src='lib/prototype.js'> </script> <script type='text/javascript' src='src/aptabs.js'> </script>
and was wondering why, can I safely merge them both with my external javascript or is there a sort of incompatibility that prevents all the code from sharing the same file?
It’s actually better performance wise to have them both in the same file- Depending on how your site is architected. The principle is to reduce the number of http requests, as each one carries some overhead.
That said, that’s something best left to the very end of production. During development it’s easier to have everything seperate. If you’re going to join them, it’s best to have an automated build script to do the operations.