View Full Version : need help with Microsoft JScript runtime error: '$' is undefined

12-30-2011, 06:46 AM
I get "Microsoft JScript runtime error: '$' is undefined" with the javascript below. How should I troubleshoot this?

<script type="text/javascript" language="javascript">
function ShowPopup() {
$('#<%=pnlpopup.ClientID %>').show();
function HidePopup() {
$('#<%=pnlpopup.ClientID %>').hide();
$(".btnClose").live('click', function () {

Old Pedant
12-30-2011, 08:13 AM
That means you haven't loaded the jQuery library.

You should have a line that looks like

<script src="...some...url...that...ends...with....jquery.js"></script>

in your page.

$ is simply a variable name (yes, JS variables can use $ and can start with $) that jQuery [and a few other libraries, but the odds or 50 to 1 it's jQuery] uses as its universal "find anything anwhere" function name.

For example, $("#mask") means essentially the same thing as document.getElementById("mask")