2010-09-24 46 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