I keep getting the following error message:
Microsoft JScript runtime error: ‘$’ is undefined
I’ve included the jquery ui js file like so:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>jquery Test Page</title>
<script src="@Url.Content("~/Scripts/jquery-1.4.1.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui-1.8.11-min.js")" type="text/javascript"></script>
<script>
$(function () {
$('#startdate').datepick({ dateFormat: 'dd/mm/yyyy' });
});
</script>
</head>
<body>
<form id="form1" runat="server">
jquery date picker test: <asp:TextBox ID="startdate" runat="server"></asp:TextBox>
</form>
</body>
</html>
I think the problem is with the URL.CONTENT include – the compiler is complaining that it can’t find the js files in the Url.Content line. But i can see them in my solution folder – they are definitely included in the Scripts folder. I think its my quotes but I can’t figure out what it is. I’ve tried changing the actual file name inside the Url.Contents to have single quotes instead of double quotes. But that didn’t resolve the problem. I’ve also tried no quotes.
Perhaps you can see what I’m missing – i’m sure its something simple that i’m overlooking.
Some things I see: