How can I submit a form to a third-party website without reloading the page (i.e. in the background)?
For some background, I am trying to programmatically register a user in my google account in the background.
I can programmatically register them using the following:
var div = document.createElement("div"); div.innerHTML = FORM_HTML; var form = div.getElementsByTagName("form")[0]; form.action = "https://www.google.com/accounts/ServiceLoginAuth"; form.GALX.value = FORM_GALX;
This brings me to the system and opens the Google toolbar. How can I prevent form.action redirecting me?
Note that this div is never added to the document, which is preferable but not required.
source share