不能得到的Jquery的DateTimePicker在mvc4显示 [英] Cannot get Jquery DateTimePicker to display in mvc4

查看:172
本文介绍了不能得到的Jquery的DateTimePicker在mvc4显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是我的脚本

<script type="text/javascript">
$(document).ready(function () {
   // alert("jquery working fine, still no display..");
    $(".datepicker").datetimepicker({
        showAnim: 'slideDown',
        dateFormat: 'dd/mm/yyyy'
    });
});
</script>

 <input type="text" class="datepicker" />

实际日期选择器的伟大工程,萤火显示了这个剧本,jQueryUI的,在timepicker-addon.js,slider.js和datepicker.js,jQuery是选择文本框。

The actual Datepicker works great, firebug shows this script, the jqueryUI, the timepicker-addon.js, slider.js, and datepicker.js, jquery is selecting the textboxes.

但很可惜,还是没有显示的DateTimePicker

but alas, still no datetimepicker displaying

我使用的ID /类试过了,重新整理脚本加载顺序。我要说的是,插件仅仅是下铺,但这么多似乎没有烦恼都用它。
有谁知道我错过了什么?

I've tried using id's/classes, rearranging the order the scripts are loaded. I would say that the addon is just bunk, but so many seem to have no troubles at all with it. Does anyone know what I am missing?

推荐答案

以下code工作完全正常,我:

The following code works perfectly fine for me:

<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
    <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <input type="text" class="datepicker" />

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
    <script type="text/javascript" src="http://trentrichardson.com/examples/timepicker/jquery-ui-timepicker-addon.js"></script>
    <script type="text/javascript">
        $('.datepicker').datetimepicker({
            showAnim: 'slideDown',
            dateFormat: 'dd/mm/yy'        
        });
    </script>
</body>
</html>

提供了以下的结果如在此活演示:

所以我想一定有什么问题你的脚本夹杂物,也许他们的订单。不幸的是因为你还没有看到您code也很难能够多说了。

So I guess there must be something wrong with your script inclusions and maybe their order. Unfortunately since you haven't shown your code it is difficult to be able to say more.

这篇关于不能得到的Jquery的DateTimePicker在mvc4显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆