当前位置:网站首页>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
边栏推荐
猜你喜欢
Quickly build a website with static files
Fluorescein-PEG-CLS, cholesterol-polyethylene glycol-fluorescein scientific research reagent
Another MySQL masterpiece published by Glacier (send the book at the end of the article)!!
First domestic open source framework 】 【 general cloud computing framework, any program can be made into cloud computing.
用两个栈模拟队列
(PC+WAP)织梦模板不锈钢类网站
ML之interpret:基于titanic泰坦尼克是否获救二分类预测数据集利用interpret实现EBC模型可解释性之全局解释/局部解释案例
The principle and use of AOSP CameraLatencyHistogram
override学习(父类和子类)
跨域的学习
随机推荐
2022-08-03 Oracle executes slow SQL-Q17 comparison
golang写的存储引擎,基于b+树,mmap
【day1】
Embedded Systems: GPIO
(PC+WAP)织梦模板不锈钢类网站
Walk the Maze BFS
如何创建一个Web项目
Deep integration of OPC UA and IEC61499 (1)
FinClip,助长智能电视更多想象空间
Summary bug 】 【 Elipse garbled solution project code in Chinese!
Creo 9.0二维草图的诊断:重叠几何
工作小计 QT打包
HCIP BGP实验报告
Testng监听器
2022/8/3 考试总结
【LeetCode】最长回文子序列(动态规划)
二叉搜索树解决落叶问题
UVa 10003 - Cutting Sticks (White Book, Interval DP)
冰河又一MySQL力作出版(文末送书)!!
什么是memoization,它有什么用?