javascript - Submitting post form via ajax, browser poup -


i'm trying submit classic post content form via javascript this. want publish/update wp post different button classic wp-publish box.

publishpost: ->     $('.tome-publish').click ->         $('form#post').submit()          location = window.location.href;         location += ( location.indexof( '?' ) != -1 ) ? '&' : '?';         location += 'wp-post-new-reload=true';         window.history.replacestate( null, null, location );         console.log( window.history ); 

but whe forms submit browser asks me

the changes made lost if navigate away page.  sure want leave page? 

do know rid of javascript nag? thank you.

when use .submit() synchronous form submit same normal form submit. if want ajax post use $.ajax instead


Comments