当前位置: 编程技术>其它
javascript 获取url参数的正则表达式(用来获取某个参数值)
来源: 互联网 发布时间:2014-10-16
本文导语: 例子: //javascript传参数(多个) var url = "B.aspx?txtA="+document.getElementById("txtName").value; url +="&txtB="+document.getElementById("txtAge").value; window.open(url,'xWindow','width=640,height=400,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,top=250,left=430...
例子:
//javascript传参数(多个)
var url = "B.aspx?txtA="+document.getElementById("txtName").value;
url +="&txtB="+document.getElementById("txtAge").value;
window.open(url,'xWindow','width=640,height=400,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,top=250,left=430');
//B.aspx目标页取得
window.open和 window.location区别:
window.open是打开新窗口
window.location是将本页替换了,也就是定位
onclick="javascript:window.location.href='/tech-program-other/XXXX.html';"
JavaScript URL参数读取改进版
http://www./article/17116.htm
//javascript传参数(多个)
var url = "B.aspx?txtA="+document.getElementById("txtName").value;
url +="&txtB="+document.getElementById("txtAge").value;
window.open(url,'xWindow','width=640,height=400,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,top=250,left=430');
//B.aspx目标页取得
代码如下:
window.open和 window.location区别:
window.open是打开新窗口
window.location是将本页替换了,也就是定位
onclick="javascript:window.location.href='/tech-program-other/XXXX.html';"
JavaScript URL参数读取改进版
http://www./article/17116.htm