.ajaxComplete有一个datepicker变更功能:能不能拿到ajaxComplete内 [英] .ajaxComplete with a datepicker change function : can't get inside the ajaxComplete
本文介绍了.ajaxComplete有一个datepicker变更功能:能不能拿到ajaxComplete内的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个datepicker,与我想尽快的时间被选择,以计算查询。我试图用.ajaxComplete,但我不能进去吧。任何想法 ?
I have a datepicker, with which I want to calculate a query as soon as the date is selected. I am trying to use the .ajaxComplete, but I can't get inside it. Any idea ?
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
</head>
<body>
<div>Date: <input type="text" id="datepicker"/></div>
<div id="result"> Turnover: </div>
<script>
$("#datepicker").change(function(){
var currentDate = $( "#datepicker" ).datepicker( "getDate" );
$("result").ajaxComplete(function(){
$(this).html("<p>Result here : </p>");
});
});
</script>
推荐答案
我找到了(假设至少一个:-))答:我什么都没有完成!我添加了一个按钮,有一个完整的事件。
I found the (let's say at least one :-)) answer : I had nothing completed ! I added a button to have a complete event.
<button class="trigger">Calculate</button>
<script>
$( ".trigger" ).click(function() {
$( ".result2" ).load( "ajax/test.html" );
});
</script>
这篇关于.ajaxComplete有一个datepicker变更功能:能不能拿到ajaxComplete内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文