我有2個函數。 First
包含Jquery-UI對話框,並從Second
函數調用。喜歡的東西:函數調用另一個函數javascript
function First() {
$('div').dialog({
buttons: {
"Ok": function() { /* code */
}
}
});
}
function Second() {
First();
/* rest of this function code is depend upon the "Ok button"
function code */
}
現在我的問題是,調用函數First
後腳本的執行不會等待dialog's Ok button press
。我該怎麼做,所以只有在按下Ok button
之後,控制才能從功能First
返回?
使用OK按鈕的回調選項 – Blaster
寫OK功能的代碼 –
移動'秒'功能'OK按鈕first'函數調用後'代碼'點擊我 – TRR