PDA

View Full Version : Javascript stopped working after combination



cryoffalcon
05-21-2012, 01:49 PM
Hi,
Well I had lots of scripts so what I did is that I combined all of them into one script file, which contains files like Jquery library too.
But now the problem is that it has stopped working, I don't know why did this happen.

What I did is that I took every script copied and pasted it and then I gave some space under it by pressing enter a few times and then I used to paste other script, I was told this was the method to combine scripts but now the scripts don't work.
Here is the link to combined scripts http://files.cryoffalcon.com/bloghuts/uncompressed/BlogHuts%20UNCOMPRESSED.js

And the link to a live example is http://bloghutsbeta.blogspot.com/

CBeery
05-22-2012, 10:49 PM
When you got too many things on startup either one cancells out the other or all codes stop working.

ApacheTech
05-23-2012, 02:44 AM
I think you will find this thread (http://www.dynamicdrive.com/forums/showthread.php?t=41961) useful in understanding why bundling a load of different scripts together, ad hoc, may cause some unforseen errors.

Keep in mind the order in which the script file is read and which scripts need to supercede others.

Creating an overall init() function may solve your problem, if you're willing to sit and read through each script and work out which needs to be executed when.