0
我在我的http中使用以下函数重定向到一些具有POST数据信息的URL。我需要将uuid1附加到新的url中,并将用户重定向到带有uuid信息的新页面http://localhost:8080/my_new_page.html。POST数据并重定向到一个url JavaScript
我能够看到POST数据的响应代码200,但它没有被重定向,当数据很大时,无法将样式表加载到我的新网址中。
我无法找到非重定向我的网址的原因。请帮助。
<input type="button" value="Click here to go back" onclick=postdata1(uuid1,respData);>
function postdata1(uuid1,respData) {
var iframe = document.createElement("iframe");
var uniqueString = "respData";
document.body.appendChild(iframe);
iframe.style.display = "none";
iframe.contentWindow.name = uniqueString;
var form = document.createElement("form");
form.target = uniqueString;
form.action = 'http://localhost:8080/my_new_page.html?uuid='+uuid1;
form.method = "POST";
var input = document.createElement("input");
input.type = "hidden";
input.name = "RespData";
input.value = respData;
form.appendChild(input);
document.body.appendChild(form);
form.submit();
}
'uuid1'和'respData'在你的代码中的任何地方声明? – artur99
是的。他们是。我也尝试在控制台上获取他们的输出。它在那里归还它们。 –