简体   繁体   English

Timepicker jquery无法正常工作(没有方法curCSS)

[英]Timepicker jquery not working (has no method curCSS)

My head is aching for already a day because of this error. 由于这个错误,我的头已经痛苦了一天。

The jQuery object is actually just the init constructor 'enhanced'
    return new jQuery.fn.init( selector, context, rootjQuery );
} has no method 'curCSS' 

my html is: 我的HTML是:

<input class="field2" type="text" name="time" placeholder="Time" value ="<?php echo $this-   >input->post('time'); ?>" id = "timepicker"/></div>

im currently using code igniter and im also using the date picker. 我目前正在使用代码点火器,我也使用日期选择器。 i think there's a conflict on the included js libraries, but still, I can't debug it. 我认为包含的js库存在冲突,但仍然无法调试它。

EDIT: These are the included js 编辑:这些是包含的js

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>

<script type="text/javascript"src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>

<script type="text/javascript" src="<?php echo base_url() ?>js_front/jquery-1.8.3.js"></script>

<script type="text/javascript" src="<?php echo base_url() ?>js_front/ui/jquery.ui.core.js"></script>

<script type="text/javascript" src="<?php echo base_url() ?>js_front/ui/jquery.ui.widget.js"></script>

<script type="text/javascript" src="<?php echo base_url() ?>js_front/ui/jquery.ui.datepicker.js"></script>

and here is the assigning of the timepicker into an input tag type text 这里是将timepicker分配到输入标签类型文本中

$(function() {
$( "#timepicker" ).timepicker();

}); });

What version of jQuery are you using? 你使用的是什么版本的jQuery? curCSS is deprecated and removed in 1.8. curCSS在1.8中已弃用并删除。 Either use an older version of jQuery or replace "curCSS" with "css" in your timepicker code. 要么使用旧版本的jQuery,要么在时间码代码中将“curCSS”替换为“css”。

http://bugs.jquery.com/ticket/11921 http://bugs.jquery.com/ticket/11921

One thing that should help you narrow it down is removing redundant/potentially conflicting script references. 应该帮助您缩小范围的一件事是删除冗余/可能冲突的脚本引用。 Your code includes a reference for two different version of jQuery and two different version of jQuery UI - that can't be a good start. 您的代码包含两个不同版本的jQuery和两个不同版本的jQuery UI的参考 - 这不是一个好的开始。

After you load the google hosted files, only load more scripts if they include plugins not already a part of the core jquery UI. 加载谷歌托管文件后,如果它们包含的插件尚未成为核心jquery UI的一部分,则只加载更多脚本。

用$ .css替换$ .curCSS(从jQuery 1.8+中删除)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM