I'm trying to submit my classic post content form via javascript like this. I want to just publish/update wp post but from different button then 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 the forms submit browser asks me
The changes you made will be lost if you navigate away from this page.
Are you sure you want to leave this page?
do you know what to do to get rid of this javascript nag? Thank you.