我从ajax调用的成功函数调用Jquery UI对话框。在该对话框的代码是这样的 -Jquery UI对话框按钮被执行而不点击
$.ajax({
'url': "../../controller/myclass.cfc",
'data':{
method: "generateQuote",
'quoteItems':quoteItems,
returnFormat: "json"
},
success: function(data){
$("#place_of_loading_image").hide();
newQuoteId = data.toString();
//New Quote Confirmation popup
$("#newQuoteAddedAlert").dialog({
autoOpen: false,
resize: 'auto',
width: 'auto',
modal: true,
closeOnEscape: false,
closeText: "Close" ,
position: "center top",
buttons: [{
text:"Continue", click: function(){
$("#newQuoteAddedAlert").dialog("close");
}},
{text:"Finish",click: function(){
$("#newQuoteAddedAlert").dialog("close");
//alert("shutup");
location.reload();
}
}]
});
//showConfirmationAlert(newQuoteId);
},error: function(objRequest, strError){
}
});
我的问题是,Finish按钮功能内location.reload()
,即会叫的对话框负载。我希望它只能在用户点击完成按钮后才能执行。
我在做什么错?
对我来说很好http://plnkr.co/edit/coWHsZZBshLDURgaItqU?p=preview – 2013-04-25 09:41:10
我明白你在那里做了什么。你从一个按钮点击来调用它。但我不能这样称呼它。我从AJAX调用的成功函数内部调用。 – nasaa 2013-04-25 09:44:27
你能分享打开对话框的代码吗 – 2013-04-25 09:54:09