Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Oct 2010
    Posts
    157
    Thanks
    2
    Thanked 1 Time in 1 Post

    Javascript stopped working after combination

    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/bloghut...NCOMPRESSED.js

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

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,730
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Your link crashes my browser.

    Best solution - do it again, making sure that your .js file does not contain any HTML tags <script type = "text/javascript"></script>



    It is your responsibility to die() if necessary….. - PHP Manual

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    Regular Coder
    Join Date
    Oct 2010
    Posts
    157
    Thanks
    2
    Thanked 1 Time in 1 Post
    Quote Originally Posted by Philip M View Post
    Your link crashes my browser.

    Best solution - do it again, making sure that your .js file does not contain any HTML tags <script type = "text/javascript"></script>



    It is your responsibility to die() if necessary….. - PHP Manual
    Which link crashes the browser as provided two and I have copied the files two times before coming here to forum but still facing this problem. Is it a bad idea to add Jquery library with other files combined? And how can I find an error if something is not closed as its Javascript and I am not good at it Just basic knowledge.

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,730
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Quote Originally Posted by cryoffalcon View Post
    Which link crashes the browser as provided two and I have copied the files two times before coming here to forum but still facing this problem. Is it a bad idea to add Jquery library with other files combined? And how can I find an error if something is not closed as its Javascript and I am not good at it Just basic knowledge.
    http://bloghutsbeta.blogspot.com/
    Line: 5
    Error: 'Array' is undefined

    Cannot escape from this continuous error without restarting browser. I am using IE9.

    I don't plan to open your .js file on security grounds. Better safe than sorry!

    It is OK to use jQuery with plain vanilla Javascript files, but not to use two different Javascript frameworks, such as jQuery and Mootools or Prototype.

    I think you will find that you have not copied the files correctly or in full, perhaps missing out a closing brace } which comes at the end of a script but with several blank lines before it. Try copying them one at a time and testing the result before proceding.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #5
    Regular Coder
    Join Date
    Oct 2010
    Posts
    157
    Thanks
    2
    Thanked 1 Time in 1 Post
    Quote Originally Posted by Philip M View Post
    http://bloghutsbeta.blogspot.com/
    Line: 5
    Error: 'Array' is undefined

    Cannot escape from this continuous error without restarting browser. I am using IE9.

    I don't plan to open your .js file on security grounds. Better safe than sorry!

    It is OK to use jQuery with plain vanilla Javascript files, but not to use two different Javascript frameworks, such as jQuery and Mootools or Prototype.

    I think you will find that you have not copied the files correctly or in full, perhaps missing out a closing brace } which comes at the end of a script but with several blank lines before it. Try copying them one at a time and testing the result before proceding.
    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?


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •