手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >js获取location.href的参数实例代码
js获取location.href的参数实例代码
摘要:window.location.search.substr(1);//substr(1)是去掉参数里最开头的?号。复制代码代码如下:func...

window.location.search.substr(1); //substr(1) 是去掉参数里最开头的?号。

复制代码 代码如下:

function getQuery(para){

var reg = new RegExp("(^|&)"+para +"=([^&]*)(&|$)");

var r = window.location.search.substr(1).match(reg);

if(r!=null){

return unescape(r[2]);

}

return null;

}

【js获取location.href的参数实例代码】相关文章:

javascript获取select值的方法分析

js实现顶部可折叠的菜单工具栏效果实例

jQuery实现的多屏图像图层切换效果实例

jquery实现弹出层效果实例

JS获取时间的相关函数及时间戳与时间日期之间的转换

JQuery插件jcarousellite的参数中文说明

javascript动态创建表格及添加数据实例详解

javascript动态设置样式style实例分析

Javascript中For In语句用法实例

JavaScript实现的MD5算法完整实例

精品推荐
分类导航