js截取地址栏参数
来源:互联网 发布:windows 7彩蛋 编辑:程序博客网 时间:2024/06/06 20:05
function gup(name) {
var regexS = "[\\?&]"+name+"=([^&#]*)"; //匹配name参数对
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );//过滤超链接
if( results == null ) {
return "";
} else {
return results[1];
}
}
使用方法:
a页面的js
window.location = 'b.html?name=张三';
b页面的js
var name = gup(“name”);即可得到传过来的参数
阅读全文
0 0
- js截取地址栏参数
- 【js工具类方法】截取地址栏参数
- js数组去重和截取地址栏参数
- js 获取地址栏参数
- JS获得地址栏参数
- JS获得地址栏参数
- js获取地址栏参数
- js 获取地址栏参数
- JS获取地址栏参数
- js 获得地址栏参数
- JS获取地址栏参数
- JS 获得地址栏参数
- js获取地址栏参数
- js获取地址栏参数
- JS解析地址栏参数
- js 获取地址栏参数
- js获取地址栏参数
- js获取地址栏参数
- QT。子窗口不析构
- oracle 行号
- tomcat windows 下发布多个域名webapp
- MySQL日志
- 系统性思维,养成模式化学习习惯
- js截取地址栏参数
- 安卓自定义shape并实现带有阴影的按钮背景效果
- 系统+线程+进程
- GitHub初学入门之快速简洁上传项目到Git
- android开发环境搭建
- 笔记
- 关联源码
- android.support.design.widget.TabLayout设置指示器的宽度
- 数组去重的几种方法