Click here to Skip to main content
15,894,896 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I got this error:

VB
Line: 11
Error: 'jQuery' is undefined


index.html
======================

XML
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="utf-8" />
    <script type="text/javascript" src="~/Scripts/jquery-1.10.2.js"></script>
    <script type="text/javascript" src="~/Scripts/jquery.maskedinput.min.js"></script>
    <script type="text/javascript">
        jQuery(function ($) {
    $("#date").mask("9999-99-99");
    });
    </script>
</head>
<body>
    <input name="date" type="text" id="date" value="" />

</body>
</html>



I need help to solve this error
Posted

1 solution

Use the dollar sign instead of the word jQuery. And remove the dollar sign inside your function declaration.
 
Share this answer
 
Comments
Member 11232188 15-Sep-15 15:51pm    
I got this error after I used the word dollar sign instead jQuery

<pre lang="vb">Line: 11
Error: '$' is undefined
</pre>

<pre lang="xml"><!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<script type="text/javascript" src="~/Scripts/jquery-1.10.2.js"></script>
<script type="text/javascript" src="~/Scripts/jquery.maskedinput.min.js"></script>
<script type="text/javascript">
$(function () {
("#date").mask("9999-99-99");
});
</script>
</head>
<body>
<input name="date" type="text" id="date" value="" />

</body>
</html
</pre>
>
ZurdoDev 15-Sep-15 16:04pm    
$ undefined means it is not loading the jquery engine. I'd make sure the jquery file is actually where you say it is.
Member 11232188 15-Sep-15 16:37pm    
The file of jquery is located in the same path
Member 11232188 15-Sep-15 16:58pm    
I removed the symbol "~" in the path .Then, it is worked fine

Thanks
ZurdoDev 15-Sep-15 19:35pm    
As you type it in you should get a browse option that allows you to browse to the file so that you get the path correct. Just for future reference.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900