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 7 of 7
  1. #1
    Regular Coder
    Join Date
    Mar 2011
    Posts
    164
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Get Error 'jQuery' is undefined - did I fix it?

    In IE9 I tested my site and there is a "helpful" box that pops up saying that there is an error on the page.

    The error I got was "Get Error 'jQuery' is undefined"

    So after some research I read that the fix is to include the JQuery link (either through the Google CDN or otherwise).

    So, I pasted that in the code and the error has gone. I guess I have fixed it but I don't really understand what I have done - I mean, did another javascript request the jquery and now all is good?

    I guess if it works it works but id like to understand how I fixed it.

    Thanks

    (I should add that I know virtually nothing about javascript, rather my contribution to the site was html and css/ design etc.).

  • #2
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    jQuery is a JavaScript library (a very handy one) that has to have a "source" of jQuery to work. You can either download it and include it locally, or you can access it via the Google CDN. Either way, without that "source", jQuery is undefined.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #3
    Regular Coder
    Join Date
    Mar 2011
    Posts
    164
    Thanks
    7
    Thanked 0 Times in 0 Posts
    ok thanks

    let me ask you though - does it do any harm if the reference to this was there but not used or needed? Or said another way, is there an argument to include it when you have other javascripts at play (in case one does actually need it)?

    I am referring to this:

    Code:
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    Thanks

  • #4
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    I think it depends upon whom you ask. Basically the jQuery code will be loaded with every page load. Since it is minified, it's not a TON of code. But some are "efficient" minded, and even the scant milliseconds that it takes to load if it's not going to be used are too much.

    So.. it's really a matter of preference, IMHO.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #5
    Regular Coder
    Join Date
    Mar 2011
    Posts
    164
    Thanks
    7
    Thanked 0 Times in 0 Posts
    ok so if the jquery was not needed but was pulled into the page it wouldn't do any harm?

    Could there be a javascript conflict if jquery was requested but not required? Thanks

  • #6
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    Quote Originally Posted by listerdl View Post
    ok so if the jquery was not needed but was pulled into the page it wouldn't do any harm?
    Correct.

    Quote Originally Posted by listerdl View Post
    Could there be a javascript conflict if jquery was requested but not required? Thanks
    I'm not sure I understand your question.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #7
    Regular Coder
    Join Date
    Mar 2011
    Posts
    164
    Thanks
    7
    Thanked 0 Times in 0 Posts
    thanks - the first bit of my question and the second bit are basically the same so thanks for helping.

    Good to know that


  •  

    Posting Permissions

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