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

推荐订阅源

Engineering at Meta
Engineering at Meta
博客园_首页
H
Help Net Security
WordPress大学
WordPress大学
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
B
Blog
I
InfoQ
SecWiki News
SecWiki News
T
Tailwind CSS Blog
Spread Privacy
Spread Privacy
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Vulnerabilities – Threatpost
N
Netflix TechBlog - Medium
P
Palo Alto Networks Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Vercel News
Vercel News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
K
Kaspersky official blog
M
MIT News - Artificial intelligence
S
Schneier on Security
T
Threat Research - Cisco Blogs
F
Fortinet All Blogs
Cyberwarzone
Cyberwarzone
Scott Helme
Scott Helme
aimingoo的专栏
aimingoo的专栏
Martin Fowler
Martin Fowler
MyScale Blog
MyScale Blog
The Cloudflare Blog
Recent Announcements
Recent Announcements
Security Latest
Security Latest
G
GRAHAM CLULEY
IT之家
IT之家
Y
Y Combinator Blog
The Last Watchdog
The Last Watchdog
腾讯CDC
Google DeepMind News
Google DeepMind News
V
V2EX
S
Securelist
TaoSecurity Blog
TaoSecurity Blog
B
Blog RSS Feed
S
SegmentFault 最新的问题
博客园 - 叶小钗
P
Proofpoint News Feed
云风的 BLOG
云风的 BLOG
Project Zero
Project Zero
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
F
Full Disclosure

博客园 - niuyy

博文阅读密码验证 - 博客园 博文阅读密码验证 - 博客园 博文阅读密码验证 - 博客园 .net 中用到excel中,检索COM类工厂中的CLSID为{000 24500-0000-0000-C000-000000000046}的组件时失败 SQL语句中,插入单引号、添加、删除字段 JS给RadioButtonList赋值 在SQL2000中不显示系统表及系统文件 Embed标签详解 可以拖动,关闭的DIV组合 获取计算机用户名 浏览器字体变小 学习小技巧 ComBox 绑定数据库 C# 读取文本文件 字符编码 ComboBox与其他控件的联动 在.net中应用事务 数据库索引应用(ms-sql) 开发人员组要注意的网站 C# 在.cs文件中使用正则表达式
客户端获取传递的参数
niuyy · 2009-07-15 · via 博客园 - niuyy

//获取地址栏参数
function GetUrl(name)
{
    var Url_Params = new Array();
    var aParams = document.location.search.substr(1).split('&');
    for (i=0; i < aParams.length; i++)
    {
        var aParam = aParams[i].split('=');
       Url_Params[aParam[0]] = aParam[1];
    }
    //取得传过来的name参数
    return Url_Params[name];
}

注:document.location.search是获取地址栏中的问号及其以后的字符串的。

如:地址:http://www.baidu.com/aaa.html?ID=298&type=2

document.location.search获取的的结果是"?ID=298&type=2"

aParams [0]="ID=298";

aParams [1]="type=2";

Url_Params的结果是:

Url_Params["ID"]=298

Url_Params["type"]=2

所以GetUrl(“ID”)返回的结果是298,GetUrl(“type”)返回的结果是2。