当前位置:网站首页>url转成对象
url转成对象
2022-04-23 06:25:00 【笔描相思】
var strUrl="http:baidu.com/stu/?lx=1&name=aa&sex=man";
var s=strUrl.indexOf('?');
var strs=strUrl.slice(s+1);
var strAry=strs.split('&');
var objs={};
for(var i=0;i<strAry.length;i++){
var item=strAry[i];
var itemAry=item.split('='),
itemAryl=itemAry[0],
itemAryr=itemAry[1];
objs[itemAryl]=itemAryr;
}
版权声明
本文为[笔描相思]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_44788119/article/details/120920772
边栏推荐
猜你喜欢
ABAP CDS VIEW WITH ASSOCIATION示例
数据分析入门 | kaggle泰坦尼克任务(三)—>探索数据分析
js之节点操作,为什么要学习节点操作
SAP PI/PO rfc2RESTful 发布rfc接口为RESTful示例(Proxy间接法)
ABAP 7.4 SQL Window Expression
Discussion on arrow function of ES6
SAP SALV14 后台输出SALV数据可直接保存文件,发送Email(带排序、超链接、筛选格式)
js之DOM学习获取元素
Implementation of MySQL persistence
Mysql持久性的实现
随机推荐
H5 case development
SAP pi / PO rfc2soap publishes RFC interface as WS example
Nacos/sentinel网关限流和分组 (代码)
SAP CR传输请求顺序、依赖检查
手游的热更方案与动态更新策略
超级宝典&编程指南(红蓝宝书)-读书笔记
Applet Wx Previewmedia related problem solving - Daily stepping on the pit
Authorization+Token+JWT
js中对象的三种创建方式
VR、AR、MR的区别与应用,以及对AR技术的一些实现原理
8. Paging query
Authorization server (simple construction of authorization server)
4.多表查询
Visualization Road (IX) detailed explanation of arrow class
On BFC (block formatting context)
SAP PI/PO功能运行状态监控检查
Solutions to common problems in visualization (VII) solutions to drawing scale setting
‘npm‘不是内部或外部命令,也不是可运行的程序 或批处理文件
Two threads print odd and even numbers interactively
How to judge whether a point is within a polygon (including complex polygons or a large number of polygons)