Home > ASP.NET, Client Side Programming, JQuery > JQuery Error : $ is undefined

JQuery Error : $ is undefined

When ever you get a JQuery ‘$ is undefined’ error, then the problem must be because reference to the jquery file is not correct and it is not loaded. Try to resolve the path of the jquery script file using Resolve URL.

<script type="text/javascript" src='<%= ResolveUrl("~/Scripts/jquery-1.3.2.js") %>’></script>

Lets say your jquery script file “jquery-1.3.2.js” is located in /Scripts under root directory, then you will have to resolve your url as said previously.

This is not a problem specific to JQuery files but is common to all master-content page. You have a master page and a content page. In the master page you have the reference to a javascript file (or css) using “~”. Unless all these files fall in the same folder you would not have any problem. The problem occurs only when the files are in different folders.

  1. nichi
    November 24, 2011 at 1:03 pm

    This script is not solving my problem…after using this script also am getting the same error “the symbol $ is undefined”

  2. nichi
    November 24, 2011 at 1:04 pm

    please any one solve my problem…thanks in advance

  3. Eddy Moens
    March 27, 2012 at 8:33 pm

    Thanks just what i needed

  4. Erick
    May 31, 2012 at 4:50 pm

    por si aun requieren saber como solucionarlo, me funcionó usar dentro del script lo siguiente:

    function pageLoad()

  5. Tomás
    July 18, 2012 at 5:13 am


  6. Eddi
    September 18, 2012 at 11:18 am

    I got the same problem if any 1 can solve it

  7. Christie
    October 26, 2012 at 7:01 pm

    I had a code file in my root directory that referenced the script:

    When I moved this code file to a subdirectory, I had to replace the circumflex ‘~’ with ‘..’:

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: