当前位置:网站首页>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
边栏推荐
- Dom4j遍历和更新XML
- Final review of Database Principles
- [rust notes] 02 ownership
- 分配异常的servlet
- Constraintlayout's constraintset dynamically modifies constraints
- [set theory] order relation (total order relation | total order set | total order relation example | quasi order relation | quasi order relation theorem | bifurcation | quasi linear order relation | q
- [concurrent programming] collaboration between threads
- Query XML documents with XPath
- MySQL index types B-tree and hash
- Redis data structure
猜你喜欢
MySQL 8
Message queue for interprocess communication
Unity editor expansion - controls, layouts
PHP uses foreach to get a value in a two-dimensional associative array (with instances)
Graphics_ Learnopongl learning notes
Unity interactive water ripple post-treatment
UE4 source code reading_ Bone model and animation system_ Animation compression
Analysis of Alibaba canal principle
MySQL three logs
UE4 source code reading_ Mobile synchronization
随机推荐
Advanced OSG collision detection
[rust notes] 09- special types and generics
Allocation exception Servlet
Explain sizeof, strlen, pointer, array and other combination questions in detail
[concurrent programming] thread foundation and sharing between threads
[rust notes] 13 iterator (Part 1)
Redis cluster series 4
How does unity fixedupdate call at a fixed frame rate
Binary to decimal, decimal to binary
【Rust 笔记】12-闭包
GIS实战应用案例100篇(七十八)-多规合一数据库设计及数据入库
Sending and receiving of request parameters
Dealing with duplicate data in Excel with xlwings
Concurrent programming (VI) ABA problems and solutions under CAS
Unity editor expansion - window, sub window, menu, right-click menu (context menu)
Visual Studio (VS) shortcut keys
[K & R] Chinese Second Edition personal questions Chapter1
Collection interface
[redis] redis persistent RDB vs AOF (source code)
Cesium for unreal quick start - simple scenario configuration