Energy of Love  
日历
<2009年8月>
2627282930311
2345678
9101112131415
16171819202122
23242526272829
303112345
统计
  • 随笔 - 70
  • 文章 - 0
  • 评论 - 80
  • 引用 - 0

导航

常用链接

留言簿

随笔分类

随笔档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜

 
aa.htm是参数输入界面
bb.htm是参数接收处理界面
aa.htm
<html>
<head>
</head>
<body>
<script>
function submit()
{
var input1 = document.getElementById("inputid");
window.open("b.html?inputStr=" + input1.value);//传入参数
}
</script>
<input type = "text" id = "inputid">
<input type = "button" onclick = "submit()" value = "提交">
</body>
</html>

bb.htm:
<html>
<head>
<script>
//获得参数的方法
var request =
{
QueryString : function(val)
{
var uri = window.location.search;
var re = new RegExp("" +val+ "=([^&?]*)", "ig");
return ((uri.match(re))?(uri.match(re)[0].substr(val.length+1)):null);
}
}

</script>

</head>
<body>
<script>
//调用方法获得参数
var rt = request.QueryString("inputStr");
alert(rt);
</script>
</body>
</html>
posted on 2009-08-22 20:13 不高兴 阅读(815) 评论(0)  编辑  收藏 所属分类: HTML/JS/CSS

只有注册用户登录后才能发表评论。


网站导航:
 
 
Copyright © 不高兴 Powered by: 博客园 模板提供:沪江博客