手机
当前位置:查字典教程网 >编程开发 >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的参数实例代码】相关文章:

jquery插件validation实现验证身份证号等

js获取页面description的方法

javascript的事件描述

document对象execCommand的command参数介绍

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

JavaScript实现的MD5算法完整实例

javascript获取select值的方法分析

获取阴历(农历)和当前日期的js代码

Javascript中For In语句用法实例

JS+CSS实现的拖动分页效果实例

精品推荐
分类导航