我從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