查看: 879|回复: 2
|
如何利用javascript做redirect? (特定的条件)
[复制链接]
|
|
我有两个pages.. ( index.aspx & result.aspx )
result.aspx是frameset page,包含了"header.aspx" and "content.aspx"
我要如何在index.aspx按下button后,就能够pass search parameter去content.aspx
(page will be redirect to result.aspx as well)
//////////////////////////////////////////////////////////////
the following is javascript i used previously:
<SCRIPT LANGUAGE="JavaScript">
function postSearch()
{
parent.main.location = "result.aspx?keywords=" + document.forms0].txt_keywords.value;
}
</SCRIPT> |
|
|
|
|
|
|
|
发表于 12-8-2006 10:09 AM
|
显示全部楼层
在FORM里SET 你的ACTION PAGE,然后在JS里用
document.form.submit();
就可以了
JS 的redirect可以用
top.location.href = ""
or
window.location.href =""
请问你还是学生吗?
[ 本帖最后由 max5007 于 12-8-2006 10:13 AM 编辑 ] |
|
|
|
|
|
|
|

楼主 |
发表于 12-8-2006 11:39 AM
|
显示全部楼层
其实我post之前有看了以下的参考
academ.hvcc.edu/~kantopet/old/javascript/index.php?page=js+frames&parent=js+frames+and+windows
javascript.internet.com/page-details/content-protector.html
但不太了解如何使用...
其实我换了一个方法已经做到我要东西(不是用javascript) ,但还是post上网看看是否有其他的解决方法
anyway.. 还是谢谢 |
|
|
|
|
|
|
| |
本周最热论坛帖子
|