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.
This script is not solving my problem…after using this script also am getting the same error “the symbol $ is undefined”
please any one solve my problem…thanks in advance
Thanks just what i needed
por si aun requieren saber como solucionarlo, me funcionó usar dentro del script lo siguiente:
function pageLoad()
{
$(documento).ready(function()
{
});
}
thanks
I got the same problem if any 1 can solve it
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 ‘..’: