lundi 2 mai 2016

How to solve Uncaught TypeError: $(...).datepicker is not a function

<head>
<meta charset="utf-8" />
<title>@ViewBag.Title</title>
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.9.1.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script>
    $(function () { $("#datepicker").datepicker();});
</script>

This is my Layout.cshtml

@Html.TextBoxFor(m => m.Date, new { @id = "datepicker", @style = "width:150px;" })

Index

But the datepicker cannot be showed and it shows Log:13 Uncaught TypeError: $(...).datepicker is not a function(anonymous function) @ Log:13fire @ jquery-1.9.1.js:1037self.fireWith @ jquery-1.9.1.js:1148jQuery.extend.ready @ jquery-1.9.1.js:433completed @ jquery-1.9.1.js:103 in the console

Aucun commentaire:

Enregistrer un commentaire