How to use iframe to (cross-domain) post request ?
问题 I want to do a post cross-domain request , I use a form which targeted a iframe to submit the request. var iframe = document.createElement("iframe"); var uniqueString = "CHANGE_THIS_TO_SOME_UNIQUE_STRING"; document.body.appendChild(iframe); iframe.style.display = "none"; iframe.contentWindow.name = uniqueString; var form = document.createElement("form"); form.target = uniqueString; form.action = myUrl; form.method = "POST"; // repeat for each parameter var input = document.createElement(