惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
V
Visual Studio Blog
宝玉的分享
宝玉的分享
IT之家
IT之家
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
I
InfoQ
B
Blog RSS Feed
T
Threatpost
博客园_首页
M
MIT News - Artificial intelligence
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Know Your Adversary
Know Your Adversary
U
Unit 42
Engineering at Meta
Engineering at Meta
C
Cyber Attacks, Cyber Crime and Cyber Security
月光博客
月光博客
Scott Helme
Scott Helme
T
Tor Project blog
有赞技术团队
有赞技术团队
AWS News Blog
AWS News Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
S
Schneier on Security
Vercel News
Vercel News
博客园 - Franky
C
Cybersecurity and Infrastructure Security Agency CISA
L
LINUX DO - 热门话题
NISL@THU
NISL@THU
L
LangChain Blog
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
The GitHub Blog
The GitHub Blog
雷峰网
雷峰网
Latest news
Latest news
C
CXSECURITY Database RSS Feed - CXSecurity.com
Hugging Face - Blog
Hugging Face - Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
G
GRAHAM CLULEY
S
Security Affairs
A
About on SuperTechFans
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
大猫的无限游戏
大猫的无限游戏
W
WeLiveSecurity
Cisco Talos Blog
Cisco Talos Blog
罗磊的独立博客

博客园 - 蔡春升

Oracle 取余取整函数 生活永远这样,在自己放松自己的时候,会让你摔个跟头,忍耐生老练,老练生盼望 IE里Iframe的Cookie问题解决办法总结(转) js 代码分析工具 QR code 二维条码 再读王永庆卖米的故事 彼得林奇 投资方法 如何访问google docs 社会化网络观后感 mysql ExecuteReader问题 互联网广告形式 概念过滤 用PDCA培养数据收集整理分析能力 韩寒:请放过我们的食油 精准化技术在互动营销中的应用 oracle 统计某个表的列数 IComparer<T> 安装WAMP怎么测试shopex 常见的WAMP集成环境
js 获取request的方法
蔡春升 · 2011-05-16 · via 博客园 - 蔡春升

通过获取url串, 然后解析“?”之后的数据。

01    function QueryString()
02    {
03        //构造参数对象并初始化
04       var name,value,i;
05        var str=location.href;//获得浏览器地址栏URL串
06       var num=str.indexOf("?")
07        str=str.substr(num+1);//截取“?”后面的参数串
08       var arrtmp=str.split("&");//将各参数分离形成参数数组
09       for(i=0;i < arrtmp.length;i++)
10        {
11            num=arrtmp[i].indexOf("=");
12            if(num>0)
13            {
14                name=arrtmp[i].substring(0,num);//取得参数名称
15                value=arrtmp[i].substr(num+1);//取得参数值
16               this[name]=value;//定义对象属性并初始化
17           }
18        }
19    }  
20     
21    //调用:
22    var abc = new QueryString();
23    alert(abc.id);//id是假如参数名称中有这个变量名

 参考:

http://jeremy.esearchs.com/index.php/archives/257.html