a.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<script>
function a()
{
var input1 = document.getElementById("inputid");
window.open("file:///C:/Users/So/Desktop/aw/b.html?inputStr=" + input1.value);//传入参数(其中,括号里面为程序文件地址)
}
</script>
<input type = "text" id = "inputid">
<input type = "button" onclick = "a()" value = "提交">
<input οnclick='window.location="view-source:" + window.location.href' type="button" value="查看源文件" name="Button7">
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<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 b = request.QueryString("inputStr");
alert(b);
</script>
<input οnclick='window.location="view-source:" + window.location.href' type="button" value="查看源文件" name="Button7">
</body>
</html>