2010-09-24 38 views

回答

2

這是因爲你打開相同對話框中,爲使其生效,你要麼需要摧毀舊對話框,如下所示:

$("#hello").dialog('destroy').attr("title", "Helloooooooo!") 

Try it here

或者只設置標題和按鈕的行爲,而無需重新創建對話框,這樣你的OK按鈕:

OK: function() { 
    $(this).dialog("close") 
     .dialog("option", { 
      buttons: { 
      OK: function() { 
       $(this).dialog("close"); 
      } 
      }, 
      title: "Helloooooooo!" 
     }).dialog("open"); 
} 

You can give that a try here

+0

非常感謝! – IsmailS 2010-09-24 12:26:01