当前位置:网站首页>JS get data
JS get data
2022-06-25 18:36:00 【ookaoooo】
js obtain get data
Nowadays, the separation of front end and back end has become a trend , That is to say, many pages are linked externally Need Customize Verbal Page to set parameters , The effective method at present is get Parameters . Through custom get Parameter is encapsulated vue Other framework Provide page variable identification ! Of course, you can also use routing .
function getPar(par){
// Get current URL
var local_url = document.location.href;
// Get what you want get Parameter position
var get = local_url.indexOf(par +"=");
if(get == -1){
return false;
}
// Intercepting string
var get_par = local_url.slice(par.length + get + 1);
// Determine if there is anything else in the intercepted string get Parameters
var nextPar = get_par.indexOf("&");
if(nextPar != -1){
get_par = get_par.slice(0, nextPar);
}
return get_par;
}/-------------------- Realization 2( return $_GET object , Imitation PHP Pattern )----------------------/
var $_GET = (function(){
var url = window.document.location.href.toString();
var u = url.split("?");
if(typeof(u[1]) == "string"){
u = u[1].split("&");
var get = {};
for(var i in u){
var j = u[i].split("=");
get[j[0]] = j[1];
}
return get;
} else {
return {};
}
})();边栏推荐
- [deeply understand tcapulusdb technology] create a game area for document acceptance
- Boiled peanuts
- Dell r530 built in hot spare status change description
- 【深入理解TcaplusDB技术】Tmonitor后台一键安装
- 2017 reading (word memory)
- connect to address IP: No route to host
- Training of long and difficult sentences in postgraduate entrance examination day81
- . How to exit net worker service gracefully
- Kwai 616 war report was launched, and the essence was thrown away for the second time to lead the new wave. Fast brand jumped to the top 3 of the hot list
- mysql视图讲解
猜你喜欢

How to sort massive data? How to process data between memory and hard disk?
![[in depth understanding of tcapulusdb technology] tcapulusdb model](/img/10/f94a5e1ebeaa803c754dd77351950f.png)
[in depth understanding of tcapulusdb technology] tcapulusdb model

【深入理解TcaplusDB技术】单据受理之创建游戏区

158_模型_Power BI 使用 DAX + SVG 打通制作商業圖錶幾乎所有可能

LeetCode-78-子集

Ruffian Heng embedded semimonthly issue 57

Addition, deletion, modification and query of mysql~ tables (detailed and easy to understand)

【深入理解TcaplusDB技术】TcaplusDB常规单据
![Current situation and trend analysis of China's glass packaging containers in 2021: the revenue of glass packaging containers increases year by year [figure]](/img/19/d93c8647415c593de9c3c959f72d64.jpg)
Current situation and trend analysis of China's glass packaging containers in 2021: the revenue of glass packaging containers increases year by year [figure]

JVM|运行时数据区(堆空间)
随机推荐
158_ Model_ Power Bi uses DAX + SVG to open up almost all possibilities for making business charts
Overview and trend analysis of China's CT examination equipment industry in 2021 [figure]
[deeply understand tcapulusdb technology] tmonitor background one click installation
Training of long and difficult sentences in postgraduate entrance examination day84
RMAN备份数据库_双重备份备份集(Duplexing Backup Sets)
[deeply understand tcapulusdb technology] table management of document acceptance
Analysis on policy, output and market scale of China's natural gas hydrogen production industry in 2020 [figure]
[deeply understand tcapulusdb technology] create a game area for document acceptance
C generic class case
Svn introduction and Usage Summary
Skills to master in advanced development
焕新出发,利尔智达天下
Pycharm 使用过程中碰到问题
Analysis on employment compensation of 2021 college graduates: the average monthly starting salary of doctors, masters, undergraduates and junior colleges is 14823 yuan, 10113 yuan, 5825 yuan and 3910
Leetcode force buckle (Sword finger offer 26-30) 26 Substructure of tree 27 Image of binary tree 28 Symmetric binary tree 29 Print matrix 30 clockwise Stack containing min function
Detailed explanation of route add command
RMAN backup database_ Skip offline, read-only, and inaccessible files
【深入理解TcaplusDB技术】创建游戏区
Class 02 loader subsystem
LeetCode-101-对称二叉树