0

Here is the code I'm using

http://jsbin.com/evike5/edit

When the jQuery UI dialog is fired second time. The updated title is not shown.

Am I doing something wrong?

1 Answer 1

2

This is because you're opening the same dialog, for it to take effect you either need to destroy the old dialog, like this:

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

Try it here.

Or just set the title and button behavior without re-creating the dialog, like this for your OK button:

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

You can give that a try here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.