您现在的位置是:网站首页> 编程资料编程资料
javascript 获取url参数的正则表达式(用来获取某个参数值)_正则表达式_
2023-05-25
429人已围观
简介 javascript 获取url参数的正则表达式(用来获取某个参数值)_正则表达式_
例子:
//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='XXXX.aspx';"
JavaScript URL参数读取改进版
https://www.jb51.net/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='XXXX.aspx';"
JavaScript URL参数读取改进版
https://www.jb51.net/article/17116.htm
您可能感兴趣的文章:
相关内容
- 正则表达式--QQ微信、优酷前端 邮箱正则表达式验证 Bug_正则表达式_
- Javascript Validation for email(正则表达式) 英文翻译_正则表达式_
- 学php正则!超基础简单例子_正则表达式_
- asp提取内容中的手机号码,qq,网址的正则代码_正则表达式_
- PHP 正则表达式特殊字符 [:alnum:] [:alpha:] 等_正则表达式_
- 正则表达式之捕获组/非捕获组介绍_正则表达式_
- 匹配yyyy-mm-dd日期格式的的正则表达式_正则表达式_
- js正则函数match、exec、test、search、replace、split使用介绍集合_正则表达式_
- JS正则中的match与exec使用说明_正则表达式_
- 检查素数的正则表达式分享_正则表达式_
