我在这里有一些问题..当在页面中(addisy.php有jquery datepicker并且它工作得很好。)我使用ajaxForm提交我的表单。提交后,页面已加载主页面,名称为isylist.php。然后,如果我再次点击addisy.php,jquery datepicker不再工作..can stackoverflow成员帮助我在代码中出错或冲突?
我的代码在这里: addisy.php
<script src="js/jquery.js"></script>
<script src="json/jquery.form.js"></script>
<script>
var j = $.noConflict();
(function() {
j('#isyform').ajaxForm({
success: function(xhr) {
},
complete: function(xhr) {
alert(xhr.responseText);
$('#frame').load('isylist.php');
}
});
})();
</script>
<div id="frame">
<form action="saveisy.php" method="post" id="isyform">
<input type="text" id="datecollected" name="datecollected" class="datepicker" />
<script>
$(document).ready(function () {
$("#datecollected").datepicker({
changeMonth: true,
changeYear: true,
dateFormat: "d-m-yy"
});
});
</script>
<input type="submit" id="save" name="save" value="Save" />
</form>
</div>