How can I open a dialog on a onSuccess ajax script
Dear All,
I use ajax to update a database. When the job is done the on susscess is lunched
- function onSuccess(data, status)
{
data = $.trim(data); //until here it works fine
$("#dialog-contenu").html(data); // It works fine
$("#dialog1").dialog(); //it doe not work
}
"data" is collecting well the value. But after I would like that the content od "data" open a dialog box and display the content.
But I do not kow how to open the dialog box with the habove code.
In the code I have a dialog page
- <!-- DIALOG EXEMPLE -->
<div data-role="dialog" id="dialog1">
<div data-role="header">Message</div>
<div data-role="content" id="dialog-contenu"></div>
</div>
Do you have an idea how to open the dialog box and by the way, how to reload the page when we close the dialog box?
Many thank for your help
Cheers