当前位置:网站首页>JS获得URL超链接的参数值
JS获得URL超链接的参数值
2022-08-03 23:10:00 【IK_LinKing】
超链接: http://xxxxxxx.html?id=10
$(function(){
var idPre = window.location.href.split("?")[1];
var id = idPre.split("=")[1];
解释说明:
window.location.href 获取整个链接
window.location.href.split(“?”)[ 1 ] ; 从?切开,[1]的意思是取右边,即取出了 id = 10
再对=分割,取右边[1],就得到了 数字10
边栏推荐
- 1067 Sort with Swap(0, i)
- 【论文阅读】TRO 2021: Fail-Safe Motion Planning for Online Verification of Autonomous Vehicles Using Conve
- 3D Semantic Segmentation - 2DPASS
- Websocket multi-threaded sending message error TEXT_PARTIAL_WRITING--Use case of spin lock replacing synchronized exclusive lock
- 软件测试内卷严重,如何提升自己的竞争力呢?
- First domestic open source framework 】 【 general cloud computing framework, any program can be made into cloud computing.
- The salary of soft testers at each stage, come to Kangkang, how much can you get?
- ML之yellowbrick:基于titanic泰坦尼克是否获救二分类预测数据集利用yellowbrick对LoR逻辑回归模型实现可解释性(阈值图)案例
- What is memoization and what is it good for?
- 关于IDO预售系统开发技术讲解丨浅谈IDO预售合约系统开发原理分析
猜你喜欢
随机推荐
Storage engine written by golang, based on b+ tree, mmap
Zilliz 2023 Fall Campus Recruitment Officially Launched!
RPA助力商超订单自动化!
代码随想录笔记_动态规划_416分割等和子集
FinClip,助长智能电视更多想象空间
伴随着元宇宙、web3.0等概念的兴起,数字人、数字场景等诸多数字化的形态开始出现
How many way of calling a function?
密码学基础以及完整加密通讯过程解析
Canvas App中点击图标生成PDF并保存到Dataverse中
HCIP BGP实验报告
3D 语义分割——2DPASS
最小化安装debian11
utlis 线程池
逆波兰表达式求值
用两个栈模拟队列
【day6】类与对象、封装、构造方法
易观分析:2022年Q2中国网络零售B2C市场交易规模达23444.7亿元
The salary of soft testers at each stage, come to Kangkang, how much can you get?
【并发编程】ReentrantLock的lockInterruptibly()方法源码分析
ML之yellowbrick:基于titanic泰坦尼克是否获救二分类预测数据集利用yellowbrick对LoR逻辑回归模型实现可解释性(阈值图)案例