当前位置:网站首页>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 {};
}
})();边栏推荐
- 网络安全检测与防范 测试题(二)
- Detailed explanation of oauth2 - Introduction (I)
- Training of long and difficult sentences in postgraduate entrance examination day87
- [elt.zip] openharmony paper Club - memory compression for data intensive applications
- Addition, deletion, modification and query of mysql~ tables (detailed and easy to understand)
- solidity获取季度时间
- 04 program counter (PC register)
- Analysis on the development trend of China's intense pulsed light equipment industry in 2021: the market scale is growing, and the proportion of imported brands is large [figure]
- 【深入理解TcaplusDB技术】单据受理之创建业务指南
- 将Graph Explorer搬上JupyterLab:使用GES4Jupyter连接GES并进行图探索
猜你喜欢
![[elt.zip] openharmony paper Club - memory compression for data intensive applications](/img/54/8248c1d95b04498d44a00ea94a6c85.png)
[elt.zip] openharmony paper Club - memory compression for data intensive applications
![Analysis on policy, output and market scale of China's natural gas hydrogen production industry in 2020 [figure]](/img/f2/ec0fe8bec503c8788d6d549845b95c.jpg)
Analysis on policy, output and market scale of China's natural gas hydrogen production industry in 2020 [figure]

158_ Model_ Power Bi uses DAX + SVG to open up almost all possibilities for making business charts
![In 2021, China's private equity market is growing, and the scale of private equity fund management reaches 19.78 trillion yuan [figure]](/img/e9/ffc5303cb6f0f8e05e93b3342a49b2.jpg)
In 2021, China's private equity market is growing, and the scale of private equity fund management reaches 19.78 trillion yuan [figure]
![[in depth understanding of tcapulusdb technology] tcapulusdb operation and maintenance](/img/7b/8c4f1549054ee8c0184495d9e8e378.png)
[in depth understanding of tcapulusdb technology] tcapulusdb operation and maintenance
![[deeply understand tcapulusdb technology] create a game zone](/img/91/cf4eae9a4336ca407c0da805b9d909.png)
[deeply understand tcapulusdb technology] create a game zone

【深入理解TcaplusDB技术】TcaplusDB机型

【深入理解TcaplusDB技术】Tmonitor后台一键安装

JVM understanding

《痞子衡嵌入式半月刊》 第 57 期
随机推荐
RMAN备份数据库_重启RMAN备份
Analysis on the market scale and pattern of contrast agents in China in 2021: Jiangsu Hengrui pharmaceutical, general electric, Yangzijiang Pharmaceutical Group, Bayer and bleco account for more than
网络安全检测与防范 练习题(三)
2021 development status of China's cloud game industry and analysis of major service providers: Although cloud games are still in their infancy, the market prospect is huge [figure]
LeetCode-78-子集
solidity日期工具
How can the self-supporting number evaluation be safer for cross-border e-commerce platforms such as Amazon, eBay, shopee, lazada, express, Wal Mart and Alibaba international?
Training of long and difficult sentences in postgraduate entrance examination English Day82
中金财富安全吗? 开户需要多久
跳一跳小游戏辅助(手动版本)py代码实现
05 virtual machine stack
RMAN backup database_ Skip offline, read-only, and inaccessible files
[deeply understand tcapulusdb technology] create a game area for document acceptance
[deeply understand tcapulusdb technology] transaction execution of document acceptance
Redis configuration (Internet access, password)
使用宝塔来进行MQTT服务器搭建
[in depth understanding of tcapulusdb technology] tcapulusdb operation and maintenance doc
. Net worker service adding a serial log record
Analysis on policy, output and market scale of China's natural gas hydrogen production industry in 2020 [figure]
Boiled peanuts