我想在javascript中添加一個自定義提醒框。我有一個JavaScript自定義警報框示例代碼,但它顯示一個靜態消息(這是在函數中給出),我想動態更改標題和消息。請告訴我在此#alert_button
函數中添加標題和消息參數的位置。如何在JavaScript函數中添加參數?
/*
jQuery document ready
You can also drag custom box.
*/
$(document).ready(function() {
$("#alert_button").click(function(e) {
e.preventDefault();
/*
jAlert is function which will show custom alert.
It has two argument.
First argument is content for alert.
Second is the Alert heading .
*/
jAlert('title', 'message');
});
});
你想如何動態地改變信息? – Scimonster 2014-10-27 12:44:52
從哪裏獲得'title'和'message'? – dfsq 2014-10-27 12:45:43
通過傳遞兩個參數(標題,消息)alert_button函數 – 2014-10-27 12:46:00