jQuery的AJAX调用后,jQuery的日期时间选择器不工作? [英] jquery datetime picker is not working after jquery ajax called?
问题描述
我正在jsp页面上使用jquery datepicker,当我调用ajax从服务器加载一些数据时,并且在成功将ajax数据加载到div标签之后,我看不到datepicker.
i am using jquery datepicker on jsp page and when i call ajax to load some data from server and on success of ajax data loads to div tag after that i cant see the datepicker.
当我单击文本字段时,我显示日期选择器,但 单击按钮通过ajax加载数据后,日期选择器不起作用
when i click on textfield i shows date picker but on click of button i m loading data through ajax and after that date picker is not working
<html>
<head>
<script>
$(document).ready(function()
{
$('#end_dtnw').datepicker({ dateFormat: 'dd-M-yy' });
$("#reportList").click(function(){
$.ajax({
type : 'Post',
url : 'www.google.com',
data: "prjid="+prjid,
beforeSend : function(){
},
success : function(data){
$('#newreportdata').html(data);
},
error : function(jqXHR, textStatus, errorThrown){
}
});
});
}
</script>
</head>
<body>
<input type="text" name="end_dtnw" id="end_dtnw" />
<input type="button" name="reportList" id="reportList" />
<div id="newreportdata"></div>
</body>
</html>
//consider that my coding is correct.....
感谢进阶...
推荐答案
此处是有关在jQuery(AJAX)中使用live()函数的日期选择器的文章:
Here is an article about the datepicker using the live() function in jQuery(AJAX):
http://www.vancelucas.com /blog/jquery-ui-datepicker-with-ajax-and-livequery/
这可以为您提供帮助.
这篇关于jQuery的AJAX调用后,jQuery的日期时间选择器不工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!