1

我刚刚开始了一个 MVC 4 项目,但我无法弄清楚 JQuery 损坏的原因:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>

    <link href="/Content/site.css" rel="stylesheet"/>

    <link href="/Content/themes/base/jquery.ui.core.css" rel="stylesheet"/>
<link href="/Content/themes/base/jquery.ui.resizable.css" rel="stylesheet"/>
<link href="/Content/themes/base/jquery.ui.selectable.css" rel="stylesheet"/>
<link href="/Content/themes/base/jquery.ui.accordion.css" rel="stylesheet"/>
<link href="/Content/themes/base/jquery.ui.autocomplete.css" rel="stylesheet"/>
<link href="/Content/themes/base/jquery.ui.button.css" rel="stylesheet"/>
<link href="/Content/themes/base/jquery.ui.dialog.css" rel="stylesheet"/>
<link href="/Content/themes/base/jquery.ui.slider.css" rel="stylesheet"/>
<link href="/Content/themes/base/jquery.ui.tabs.css" rel="stylesheet"/>
<link href="/Content/themes/base/jquery.ui.datepicker.css" rel="stylesheet"/>
<link href="/Content/themes/base/jquery.ui.progressbar.css" rel="stylesheet"/>
<link href="/Content/themes/base/jquery.ui.theme.css" rel="stylesheet"/>


    <script src="/Scripts/modernizr-2.5.3.js"></script>


    <script src="/Scripts/jquery-1.7.1.js"></script>


    <script src="/Scripts/jquery-ui-1.8.20.js"></script>


    <script type="text/javascript">
        $(document).ready(function () {
            $("#datepicker").datepicker();
        });
    </script>

</head>
<body>


<h2>List</h2>

<p>Date: <input type="text" id="datepicker" /></p>


    <script src="/Scripts/jquery-1.7.1.js"></script>


</body>
</html>

标题中的链接工作得很好。我在 Chrome 中收到此错误:

Uncaught TypeError: Object [object Object] has no method 'datepicker' 
4

1 回答 1

-1

在使用datetimepikerdatepicker函数之前插入此代码

var jq = $.noConflict();
于 2013-06-03T11:12:41.343 回答