Skip to content

Instantly share code, notes, and snippets.

@isubas
Last active August 29, 2015 14:13
Show Gist options
  • Save isubas/be6f5703676a2faa00f7 to your computer and use it in GitHub Desktop.
Save isubas/be6f5703676a2faa00f7 to your computer and use it in GitHub Desktop.
ajax-dialog
var $link = ""
$( "a" ).click(function() {
$link = $(this)
console.log($link.text());
});
$( "form" ).submit(function( event ) {
// Stop form from submitting normally
event.preventDefault();
var postData = $(this).serializeArray();
var url = $(this).attr("action");
var posting = $.post( url, postData );
posting.done(function( data ) {
$( "#dialog" ).dialog('close');
$link.text("aa")
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment