当前位置:网站首页>JS get link? The following parameter name or value, according to the URL? Judge the parameters after
JS get link? The following parameter name or value, according to the URL? Judge the parameters after
2022-04-23 17:44:00 【Youyoujing】
var url = location.search; // obtain url in "?" The string after the sign , Include ?
console.log(url);
function GetRequest() {
var url = location.search; // obtain url in "?" The string after the sign
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]);
}
}
return theRequest;
}
var Request = undefined;
Request = GetRequest();
console.log(Request);// Last obtained field name + value
const keys= Object.keys(Request);
console.log(keys);// Array
console.log(keys[0]);// Output a
Case study :
Design draft :

according to url The parameter judgment status after is : resolved , Unresolved , All ;
var url = location.search; // obtain url in "?" The string after the sign , Include ?
// console.log(url);
function GetRequest() {
var url = location.search; // obtain url in "?" The string after the sign
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]);
}
}
return theRequest;
}
var Request = undefined;
Request = GetRequest();
// console.log(Request);// Last obtained field name + value
// const keys= Object.keys(Request);
// console.log(keys);// Array
// console.log(keys[0]);// Output a
let status = Request.status;
if(status == 2){
$('.tit05 .tit05div .zhuangtai').text(' All ');
}else if(status == 1){
$('.tit05 .tit05div .zhuangtai').text(' resolved ');
}else{
$('.tit05 .tit05div .zhuangtai').text(' Unresolved ');
}
Reference article :
js For a link ? The parameter name or value behind :https://www.cnblogs.com/zxcc/p/11454196.html
版权声明
本文为[Youyoujing]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230550532016.html
边栏推荐
- Chrome浏览器的跨域设置----包含新老版本两种设置
- Tdan over half
- 常用SQL语句总结
- Future usage details
- 386. Dictionary order (medium) - iteration - full arrangement
- 198. Looting - Dynamic Planning
- Gets the time range of the current week
- Exercise: even sum, threshold segmentation and difference (two basic questions of list object)
- Flask项目的部署详解
- 超分之TDAN
猜你喜欢

Kubernetes service discovery monitoring endpoints

Compilation principle first set follow set select set prediction analysis table to judge whether the symbol string conforms to the grammar definition (with source code!!!)

1217_ Generating target files using scons

102. 二叉树的层序遍历

On the method of outputting the complete name of typeID from GCC

常用SQL语句总结

SystemVerilog (VI) - variable

Dry goods | how to extract thumbnails quickly?

440. 字典序的第K小数字(困难)-字典树-数节点-字节跳动高频题

干货 | 快速抽取缩略图是怎么练成的?
随机推荐
[二叉数] 二叉树的最大深度+N叉树的最大深度
2022制冷与空调设备运行操作判断题及答案
PC uses wireless network card to connect to mobile phone hotspot. Why can't you surf the Internet
31. 下一个排列
为什么有些人说单片机简单,我学起来这么吃力?
油猴网站地址
In ancient Egypt and Greece, what base system was used in mathematics
JVM class loading mechanism
Manually implement call, apply and bind functions
958. 二叉树的完全性检验
2021长城杯WP
Type judgment in [untitled] JS
剑指 Offer 03. 数组中重复的数字
1217_ Generating target files using scons
92. 反转链表 II-字节跳动高频题
198. Looting - Dynamic Planning
Allowed latency and side output
Sword finger offer 22 The penultimate node in the linked list - speed pointer
干货 | 快速抽取缩略图是怎么练成的?
Node template engine (EJS, art template)