1

I have a live site and I open it on Internet explorer and right click on page and click on view source and copy all code from it and paste it on vs2010->Newwebsite and when i run my site on vs2010 an error occur.

Microsoft JScript runtime error: '$' is undefined

I don't understand what I do. Kindly suggest me. waiting for reply. Thanks

3
  • Did you include jquery.min.js file on top? Commented Dec 9, 2013 at 7:40
  • include jquery $ is a jquery symbol so u have to include the one if u wanna use it Commented Dec 9, 2013 at 7:41
  • Can we see your code? Commented Dec 9, 2013 at 7:43

2 Answers 2

2

You'd fix that by including jQuery!

Add the following to your page

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

However, it sounds like just an error in Visual Studio, and if it works when viewing the page in a browser, it shouldn't be an issue.

Sign up to request clarification or add additional context in comments.

5 Comments

or any other script that provides $ as global variable.
@AdamMoszczyński - The question is tagged jQuery, so I assumed the $ was jQuery. Could be a number of other things, scripts overwriting $, noConflict mode, as in Wordpress etc.
@HassanAliKhan - Then it's not loading, or you're not including before you're trying to use it, or $ is overwritten by something else. Is this just in VS2010, or in the browser as well.
@HassanAliKhan: Check that you have that Scripts/jquery.qtip-1.0.0-rc3.min.js on the server
@HassanAliKhan:- If your script is in a Scripts directory then you just use Scripts/jquery.qtip-1.0.0-rc3.min.js because with a web server, everything is within it's root (top level) directory.
0

First verify that jQuery is in fact being loaded.

if (window.jQuery) {  
  alert("jQuery is loaded!");
}

If that works, then you are most likely using something like jQuery.noconflict() to remove the alias $ for jQuery.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.