JS脚本页面间的URL传值
比如:有两个页面a.html和b.htmlJS脚本有没有类似于C#.net的URL页面传值(比如:a.html页面Response.Redirect("b.aspx?id...
比如:有两个页面
a.html 和 b.html
JS脚本有没有类似于C#.net的URL页面传值(比如:a.html页面Response.Redirect("b.aspx?id=" + TextBox1.Text + ""); b.html页面Label1.Text = Request.QueryString["id"];)这样的传值方法,麻烦请举个例子,谢谢各位大侠 展开
a.html 和 b.html
JS脚本有没有类似于C#.net的URL页面传值(比如:a.html页面Response.Redirect("b.aspx?id=" + TextBox1.Text + ""); b.html页面Label1.Text = Request.QueryString["id"];)这样的传值方法,麻烦请举个例子,谢谢各位大侠 展开
展开全部
VidList.html 部分内容
<div class="neirong_wenben"><div id="cont">
<table border="0" cellpadding="0" cellspacing="0" bordercolor="#99CC33" width="100%" height="100%">
<tr bgcolor="#E3F4FE">
<td align="left" width="80%">
<a href="OneVid.html?id=M2U00033">古诗词诵读(一)........................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00033">进入观赏>></a></td>
</tr>
<tr>
<td align="left">
<a href="OneVid.html?id=M2U00100">古诗词诵读(二)........................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00100">进入观赏>></a></td>
</tr>
<tr bgcolor="#E3F4FE">
<td align="left">
<a href="OneVid.html?id=M2U00222">书记检查德育工作(一)..................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00222">进入观赏>></a></td>
</tr>
<tr>
<td align="left">
<a href="OneVid.html?id=M2U00225">书记检查德育工作(二)..................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00225">进入观赏>></a></td>
</tr>
<tr bgcolor="#E3F4FE">
<td align="left">
<a href="OneVid.html?id=M2U00032">书香满校园之一..........................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00032">进入观赏>></a></td>
</tr>
<tr>
<td align="left">
<a href="OneVid.html?id=M2U00073">书香满校园之二..........................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00073">进入观赏>></a></td>
</tr>
<tr bgcolor="#E3F4FE">
<td align="left">
<a href="OneVid.html?id=M2U00077">书香满校园之三..........................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00077">进入观赏>></a></td>
</tr>
<tr>
<td align="left">
<a href="OneVid.html?id=M2U00080">书香满校园之四..........................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00080">进入观赏>></a></td>
</tr>
<tr bgcolor="#E3F4FE">
<td align="left">
<a href="OneVid.html?id=M2U00102">书香满校园之五..........................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00102">进入观赏>></a></td>
</tr>
<tr>
<td align="left">
<a href="OneVid.html?id=M2U00013">赈灾之一................................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00013">进入观赏>></a></td>
</tr>
<tr bgcolor="#E3F4FE">
<td align="left">
<a href="OneVid.html?id=M2U00025">赈灾之二................................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00025">进入观赏>></a></td>
</tr>
<tr>
<td align="left">
<a href="OneVid.html?id=M2U00026">赈灾之三................................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00026">进入观赏>></a></td>
</tr>
<tr bgcolor="#E3F4FE">
<td align="left">
<a href="OneVid.html?id=M2U00027">赈灾之四................................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00027">进入观赏>></a></td>
</tr>
<tr>
<td align="left">
<a href="OneVid.html?id=M2U00034">赈灾之五................................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00034">进入观赏>></a></td>
</tr>
<tr bgcolor="#E3F4FE">
<td align="left">
<a href="OneVid.html?id=M2U00043">赈灾之六................................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00043">进入观赏>></a></td>
</tr>
<tr>
<td align="left">
<a href="OneVid.html?id=M2U00065">赈灾之七................................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00065">进入观赏>></a></td>
</tr>
<tr bgcolor="#E3F4FE">
<td align="left">
<a href="OneVid.html?id=体育节">体育节..................................</a></td>
<td width="20%"><a href="OneVid.html?id=体育节">进入观赏>></a></td>
</tr>
</table>
</div></div>
文件:OneVid.html 部分代码(JS接收传递值在此进行)
<div class="neirong_Left">
<div class="libiao_LeftTit"><a href="Index.html" target="_blank">首页 </a>> <a href="VidList.html" target="_blank">视频列表</a> > 单张展示</div>
<div class="neirong">
<div class="neirong_biaoti">
<div id="mocrTitle"><!--这里是标题信息--></div></div>
<div class="neirong_laiyuan"><div id="mocrTime">2009-06-19</div></div>
<div class="neirong_wenben"><div id="cont" align="center">
<!--这里插入视频文件代码-->
</div></div>
<div class="neirong_wenben right"></div>
责任编辑:XXX
</div>
</div>
<!--以下JS内容放在HTML文件最末-->
<script language="javascript" type="text/javascript">
var List = [["M2U00033","古诗词诵读(一)","M2U00033.wmv"],
["M2U00100","古诗词诵读(二)","M2U00100.wmv"],
["M2U00222","书记检查德育工作(一)","M2U00222.wmv"],
["M2U00225","书记检查德育工作(二)","M2U00225.wmv"],
["M2U00032","书香满校园之一","M2U00032.wmv"],
["M2U00073","书香满校园之二","M2U00073.wmv"],
["M2U00077","书香满校园之三","M2U00077.wmv"],
["M2U00080","书香满校园之四","M2U00080.wmv"],
["M2U00102","书香满校园之五","M2U00102.wmv"],
["M2U00013","赈灾之一","M2U00013.wmv"],
["M2U00025","赈灾之二","M2U00025.wmv"],
["M2U00026","赈灾之三","M2U00026.wmv"],
["M2U00027","赈灾之四","M2U00027.wmv"],
["M2U00034","赈灾之五","M2U00034.wmv"],
["M2U00043","赈灾之六","M2U00043.wmv"],
["M2U00065","赈灾之七","M2U00065.wmv"],
["体育节","体育节","体育节.wmv"]
];
//增加正则表达式
String.prototype.getQueryString = function(name)
{
var reg = new RegExp("(^|&|\\?)"+ name +"=([^&]*)(&|$)"), r;
if (r=this.match(reg)) return unescape(r[2]);
return null;
};
var sId = location.search.getQueryString("id"); //通过表达式获得传递参数
//alert(sId);
//var IDID = "25"
for(var i = 0;i<20; i++){
if(sId == List[i][0])
{
document.getElementById('mocrTitle').innerHTML =List[i][1]; //这里写入标题信息
document.getElementById('cont').innerHTML = "<embed src='vidio/"+List[i][2]+"' width ='600px' height='500px' autostart='true'></embed> ";//这里写入图片信息
//<embed src="TodImage/123.mpg" width="600" height="400" autostart="true"></embed>
}
}
</script>
<div class="neirong_wenben"><div id="cont">
<table border="0" cellpadding="0" cellspacing="0" bordercolor="#99CC33" width="100%" height="100%">
<tr bgcolor="#E3F4FE">
<td align="left" width="80%">
<a href="OneVid.html?id=M2U00033">古诗词诵读(一)........................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00033">进入观赏>></a></td>
</tr>
<tr>
<td align="left">
<a href="OneVid.html?id=M2U00100">古诗词诵读(二)........................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00100">进入观赏>></a></td>
</tr>
<tr bgcolor="#E3F4FE">
<td align="left">
<a href="OneVid.html?id=M2U00222">书记检查德育工作(一)..................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00222">进入观赏>></a></td>
</tr>
<tr>
<td align="left">
<a href="OneVid.html?id=M2U00225">书记检查德育工作(二)..................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00225">进入观赏>></a></td>
</tr>
<tr bgcolor="#E3F4FE">
<td align="left">
<a href="OneVid.html?id=M2U00032">书香满校园之一..........................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00032">进入观赏>></a></td>
</tr>
<tr>
<td align="left">
<a href="OneVid.html?id=M2U00073">书香满校园之二..........................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00073">进入观赏>></a></td>
</tr>
<tr bgcolor="#E3F4FE">
<td align="left">
<a href="OneVid.html?id=M2U00077">书香满校园之三..........................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00077">进入观赏>></a></td>
</tr>
<tr>
<td align="left">
<a href="OneVid.html?id=M2U00080">书香满校园之四..........................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00080">进入观赏>></a></td>
</tr>
<tr bgcolor="#E3F4FE">
<td align="left">
<a href="OneVid.html?id=M2U00102">书香满校园之五..........................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00102">进入观赏>></a></td>
</tr>
<tr>
<td align="left">
<a href="OneVid.html?id=M2U00013">赈灾之一................................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00013">进入观赏>></a></td>
</tr>
<tr bgcolor="#E3F4FE">
<td align="left">
<a href="OneVid.html?id=M2U00025">赈灾之二................................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00025">进入观赏>></a></td>
</tr>
<tr>
<td align="left">
<a href="OneVid.html?id=M2U00026">赈灾之三................................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00026">进入观赏>></a></td>
</tr>
<tr bgcolor="#E3F4FE">
<td align="left">
<a href="OneVid.html?id=M2U00027">赈灾之四................................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00027">进入观赏>></a></td>
</tr>
<tr>
<td align="left">
<a href="OneVid.html?id=M2U00034">赈灾之五................................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00034">进入观赏>></a></td>
</tr>
<tr bgcolor="#E3F4FE">
<td align="left">
<a href="OneVid.html?id=M2U00043">赈灾之六................................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00043">进入观赏>></a></td>
</tr>
<tr>
<td align="left">
<a href="OneVid.html?id=M2U00065">赈灾之七................................</a></td>
<td width="20%"><a href="OneVid.html?id=M2U00065">进入观赏>></a></td>
</tr>
<tr bgcolor="#E3F4FE">
<td align="left">
<a href="OneVid.html?id=体育节">体育节..................................</a></td>
<td width="20%"><a href="OneVid.html?id=体育节">进入观赏>></a></td>
</tr>
</table>
</div></div>
文件:OneVid.html 部分代码(JS接收传递值在此进行)
<div class="neirong_Left">
<div class="libiao_LeftTit"><a href="Index.html" target="_blank">首页 </a>> <a href="VidList.html" target="_blank">视频列表</a> > 单张展示</div>
<div class="neirong">
<div class="neirong_biaoti">
<div id="mocrTitle"><!--这里是标题信息--></div></div>
<div class="neirong_laiyuan"><div id="mocrTime">2009-06-19</div></div>
<div class="neirong_wenben"><div id="cont" align="center">
<!--这里插入视频文件代码-->
</div></div>
<div class="neirong_wenben right"></div>
责任编辑:XXX
</div>
</div>
<!--以下JS内容放在HTML文件最末-->
<script language="javascript" type="text/javascript">
var List = [["M2U00033","古诗词诵读(一)","M2U00033.wmv"],
["M2U00100","古诗词诵读(二)","M2U00100.wmv"],
["M2U00222","书记检查德育工作(一)","M2U00222.wmv"],
["M2U00225","书记检查德育工作(二)","M2U00225.wmv"],
["M2U00032","书香满校园之一","M2U00032.wmv"],
["M2U00073","书香满校园之二","M2U00073.wmv"],
["M2U00077","书香满校园之三","M2U00077.wmv"],
["M2U00080","书香满校园之四","M2U00080.wmv"],
["M2U00102","书香满校园之五","M2U00102.wmv"],
["M2U00013","赈灾之一","M2U00013.wmv"],
["M2U00025","赈灾之二","M2U00025.wmv"],
["M2U00026","赈灾之三","M2U00026.wmv"],
["M2U00027","赈灾之四","M2U00027.wmv"],
["M2U00034","赈灾之五","M2U00034.wmv"],
["M2U00043","赈灾之六","M2U00043.wmv"],
["M2U00065","赈灾之七","M2U00065.wmv"],
["体育节","体育节","体育节.wmv"]
];
//增加正则表达式
String.prototype.getQueryString = function(name)
{
var reg = new RegExp("(^|&|\\?)"+ name +"=([^&]*)(&|$)"), r;
if (r=this.match(reg)) return unescape(r[2]);
return null;
};
var sId = location.search.getQueryString("id"); //通过表达式获得传递参数
//alert(sId);
//var IDID = "25"
for(var i = 0;i<20; i++){
if(sId == List[i][0])
{
document.getElementById('mocrTitle').innerHTML =List[i][1]; //这里写入标题信息
document.getElementById('cont').innerHTML = "<embed src='vidio/"+List[i][2]+"' width ='600px' height='500px' autostart='true'></embed> ";//这里写入图片信息
//<embed src="TodImage/123.mpg" width="600" height="400" autostart="true"></embed>
}
}
</script>
展开全部
a.html:
window.open('b.html','Page2','width=400,height=600');
b.html:
document.getElementById('b界面的文本框id').value=window.opener.document.getElementById('a界面文本框的id').value;
window.open('b.html','Page2','width=400,height=600');
b.html:
document.getElementById('b界面的文本框id').value=window.opener.document.getElementById('a界面文本框的id').value;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
javascript:window.location="b.aspx?id="+document.getelmentbyid(Texbbox1).value
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询