gpt4 book ai didi

javascript - JavaScript帖子

转载 作者:行者123 更新时间:2023-11-30 07:48:38 25 4
gpt4 key购买 nike

我有一个JavaScript函数,可以用来打开一个新窗口,在此新窗口中发布表单并检查那里的结果。

该代码在IE7中工作正常,但在FF3中不工作。有人知道为什么吗?我在按钮onclick事件中调用此函数:

function OpenEdit(id){
var sData;
var sDomain = "http://foobar.org/index.php?";
sData = "<form name='editUser' id='editUser' action='" + sDomain + "page=adm/update' method='post'>";
sData = sData + "<input type='hidden' name='id' value='" + id + "'/>";
sData = sData + "</form>";
sData = sData + "<script type='text/javascript'>document.editUser.submit();</scr" + "ipt>";
OpenWindow=window.open("", "newwin");
OpenWindow.document.write(sData);
OpenWindow.document.close();
}

最佳答案

您的标签在哪里


html
身体


添加这些,可能对您更好

function OpenEdit(id){
var sData;
var sDomain = "http://foobar.org/index.php?";
sData = "<html><body>";
sData = sData + "<form name='editUser' id='editUser' action='" + sDomain + "page=adm/update' method='post'>";
sData = sData + "<input type='hidden' name='id' value='" + id + "'/>";
sData = sData + "</form>";
sData = sData + "<script type='text/javascript'>document.editUser.submit();</scr" + "ipt>";
sData = sData + "</body></html>";
OpenWindow=window.open("", "newwin");
OpenWindow.document.write(sData);
OpenWindow.document.close();
}

关于javascript - JavaScript帖子,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/258235/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com