Since, loadOneTab()
is not available for formData
,
- How can
formData
be posted to a new tab? - How can the above new tab foreground/background status be set?
Just a smaple example from Using FormData Objects:
var formData = new FormData();
formData.append("username", "Groucho");
formData.append("accountnum", 123456); // number 123456 is immediately converted to string "123456"
// HTML file input user's choice...
formData.append("userfile", fileInputElement.files[0]);
// JavaScript file-like object...
var content = '<a id="a"><b id="b">hey!</b></a>'; // the body of the new file...
var blob = new Blob([content], { type: "text/xml"});
formData.append("webmasterfile", blob);
var request = new XMLHttpRequest();
request.open("POST", "http://foo.com/submitform.php");
request.send(formData);
Clarification:
Normal HTML form with a target="_blank"
will POST the form data to a new tab.
Similarly, as mentioned, loadOneTab()
can also POST data to a new tab.
Is it possible to do so with XMLHttpRequest?