问题
I have a custome wordpress site I run, if a customer ticks a box on an angularjs based application form, I need to open a new tab by posting into an admin-post.php action but also continue processing the angularjs application in the original tab.
So the end result should be a new tab with a posted form and the existing tab with the results of the angularjs which is more ajax posts into the wordpress site.
What is happening is the form submit into a new tab is hanging behind the processing being done on ajax in the original tab. I'd prefer this to be flipped but also can't see why it's happening. Aren't 2 posts into the same wordpress, one admin-post and one ajax being treated separately?
It's difficult to provide examples as the site is sensitive but my angularjs runs something like
function processForm() {
runSubmit();
//Do the rest of the application submit via ajax and await response
}
function runSubmit() {
form1.submit();
}
Basically the ajax code in the processForm() function is holding up the results of the runSubmit() form submit until it's complete.
I'm hoping a simple sleep somewhere will do the trick but not had any luck so far.
Thanks in advance.
来源:https://stackoverflow.com/questions/59862329/wordpress-submit-form-into-new-tab-and-continue-processing