当前位置:网站首页>Get the link behind? Parameter value after question mark
Get the link behind? Parameter value after question mark
2022-07-03 08:47:00 【bin9153】
// function
function GetRequest2(key)
{
var url = location.search;
var theRequest = new Object();
if (url.indexOf("?") != -1)
{
var str = url.substr(1);
strs = str.split("&");
for (var i = 0; i < strs.length; i++)
{
theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
}
}
var value = theRequest[key];
return value;
}
// call
GetRequest2('namenum');
// for example www.xxx.com?namenum=1
// Output 1
边栏推荐
- MySQL containerization (1) docker installation MySQL
- [concurrent programming] atomic operation CAS
- 【Rust 笔记】12-闭包
- UE4 source code reading_ Mobile synchronization
- Graphics_ Learnopongl learning notes
- [public key cryptography] ECC elliptic cryptosystem (implementing ElGamal encryption method)
- How to deal with the core task delay caused by insufficient data warehouse resources
- [rust notes] 07 structure
- Collection interface
- [concurrent programming] working mechanism and type of thread pool
猜你喜欢
Unity editor expansion - scrolling list
JS ternary operator - learning notes (with cases)
VIM learning notes from introduction to silk skating
Annotations simplify configuration and loading at startup
单调栈-42. 接雨水
Notes on understanding applets 2022/7/3
Sending and receiving of request parameters
[concurrent programming] Table hopping and blocking queue
I made mistakes that junior programmers all over the world would make, and I also made mistakes that I shouldn't have made
MySQL 8
随机推荐
GIS实战应用案例100篇(七十八)-多规合一数据库设计及数据入库
22-05-26 西安 面试题(01)准备
Dom4j traverses and updates XML
Redux - learning notes
Redis cluster series 4
Osgearth starry background
Unity editor expansion - controls, layouts
Message pack in C deserializes array objects
Gradle's method of dynamically modifying APK package name
Unity Editor Extension - event handling
UE4 source code reading_ Bone model and animation system_ Animation node
Vscode, idea, VIM development tool shortcut keys
了解小程序的笔记 2022/7/3
【Rust 笔记】11-实用特型
[audio and video] ijkplayer error code
22-06-28 西安 redis(02) 持久化机制、入门使用、事务控制、主从复制机制
二进制转十进制,十进制转二进制
VIM learning notes from introduction to silk skating
请求参数的发送和接收
[concurrent programming] concurrent tool class of thread