Jquery日期选择器不起作用 [英] Jquery Date Picker Not working

查看:117
本文介绍了Jquery日期选择器不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个母版页和一个内容页。我在母版页中引用了jquery,jquery-ui文件。我有一个用户控件,我有一个需要附加到datepicker的文本框。



问题是我在用户的document.ready函数中将datepicker附加到textbox控制,我得到的错误就像没有定义datepicker。



当我在用户控件中引用jquery,jquery-ui文件时,datepicker工作正常。但是,问题是我正在调用jquery,jquery-ui文件两次,这打破了其他功能。



你可以帮助附加日期选择器而不加载两次jquery文件

Hi,

I have a master page and a content page. I have referenced the jquery, jquery-ui files in the master page. I have a user control where I have a text box which needs to attache to datepicker.

The problem is when I attach datepicker to textbox in document.ready function of user control, i get error like datepicker is not defined.

When I give reference to jquery, jquery-ui files in user control, then the datepicker is working fine. But, the issue is I am calling jquery, jquery-ui files twice which is breaking other functionality.

Can you please help to attach the datepicker without loading jquery files twice

推荐答案

//Check the references 



https://jqueryui.com/datepicker/ [ ^ ]


在多个团队成员检查到问题后,我们发现jquery文件多次加载。发生这种情况是因为我们在aspx页面中添加了jquery文件引用,然后我们在文件后面的代码中添加了相同的文件作为web资源。所以同一个文件被多次加载。除此之外,当我们使用jquery-ui.min.js时,我们得到的元素msie没有定义。但是,当我们使用jquery-ui.js时,我们没有得到这个错误。



主要问题是多次加载jquery文件。
After multiple team members checked the issue, we found that the jquery file was getting loaded multiple times. This was happening because we added jquery file reference in aspx page and then we have add the same file in code behind file as web resource. So the same file was getting loaded multiple times. Other than that, when we were using jquery-ui.min.js we were getting element msie is not defined. But, when we used jquery-ui.js we did not get this error.

The main issue is multiple loads of jquery file.


这篇关于Jquery日期选择器不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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