function redirectHome() {
alert("here1");
function setHref() {
alert("here2");
window.parent.location.href="fprIndex.html?action=edit&aspect=<%=request("aspect")%>&id=<%=request("Request_ID")%>";
};
document.forms["form1"].submit();
var timer = setTimeout( setHref, 1000 );
}
Run Code Online (Sandbox Code Playgroud)
redirectHome()通过按钮"onClick()"事件调用.
可以看到第一个警报"here1",但从未见过"here2".
怎么了?
如果我只是简单地工作是什么:
function redirectHome() {
document.forms["form1"].submit();
window.parent.location.href="fprIndex.html?action=edit&aspect=<%=request("aspect")%>&id=<%=request("Request_ID")%>";
}
Run Code Online (Sandbox Code Playgroud)
我要做的是从表单提交到重定向发生的时间延迟1秒 - 纯粹是出于审美原因.
| 归档时间: |
|
| 查看次数: |
477 次 |
| 最近记录: |