Javascript stopped working after combination

Discussion in 'Programming' started by cryoffalcon, May 21, 2012.

  1. #1
    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 UNCOMPRESSED.js

    And the link to a live example is http://bloghutsbeta.blogspot.com/
     
    cryoffalcon, May 21, 2012 IP
  2. HostPlanz

    HostPlanz Well-Known Member

    Messages:
    449
    Likes Received:
    34
    Best Answers:
    4
    Trophy Points:
    130
    #2
    Did you combine the scripts in the same order as when they were separated. If one script relies on code from another script, it must come after the script that it relies on. Just like if you write a script using jQuery, it must come after jQuery.js


    Why would you want to do that instead of included them each from a different file in the HTML header anyway?
     
    HostPlanz, May 21, 2012 IP
  3. cryoffalcon

    cryoffalcon Peon

    Messages:
    102
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Well I found out what is the reason for the error it is because when I was using combined version I was combining Jquery 1.7 while when they were separate it was 1.5, so when I used 1.5 in combined too, it resolved the Issue now I don't understand why is the new Jquery creating issues?
     
    cryoffalcon, May 21, 2012 IP
  4. HostPlanz

    HostPlanz Well-Known Member

    Messages:
    449
    Likes Received:
    34
    Best Answers:
    4
    Trophy Points:
    130
    #4
    Hmm, strange...... jQuery should be backward compatible, not so?
    You should read the jQuery docs to find out why the error is occurring, and probably re-write your code to suit the updated versions.
     
    HostPlanz, May 21, 2012 IP
  5. cryoffalcon

    cryoffalcon Peon

    Messages:
    102
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Well thanks for your reply and I am glad my issue is resolved ^^
    As far as rewriting codes are concerned they are out of field area as I am an accountant I am not that talented in coding up till now :D But at least it do support old version of Jquery.
     
    cryoffalcon, May 21, 2012 IP