I am trying to post data from my form to a jquery dialog that loads external content.
I am serializing the form data which works (appears in the url) but the dialog won’t open:
$("#wavajax button").click(function() {
$.post({url: 'player/index.php', data: $("#wavajax").serialize(),
success: function (data) {
$("#recordingdialog").load("player/index.php", [], function(){
$("#recordingdialog").dialog("open");
}
});
return false;
});
What am I doing wrong, am I going about it the right way???
I think this is what you’re after:
You’re already getting the HTML content back from the POST (or at least I would think this is the case), so just put that response in the
#recordingdialogusing.html()and then make the dialog call. If you’re not previously creating a dialog with options, then just.dialog()will suffice,.dialog('open')is intended for when you created the dialog earlier with various options and want to now open it, like this:You can find a full list of these options here