当前位置:网站首页>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
边栏推荐
- AOSP CameraLatencyHistogram的原理与使用
- Unity2021 releases WebGL fog effect disappearing problem
- 最小化安装debian11
- Why do we need callbacks
- 数据分析知识点搜集(纯粹的搜集)
- 物联网新零售模式,引领购物新潮流
- P1996 约瑟夫问题
- SPOJ 2774 Longest Common Substring(两串求公共子串 SAM)
- Binary search tree to solve the fallen leaves problem
- BMN: Boundary-Matching Network for Temporal Action Proposal Generation阅读笔记
猜你喜欢
随机推荐
Take an example of a web worker
OPC UA 与IEC61499 深度融合(1)
P1996 约瑟夫问题
【RYU】rest_router.py源码解析
Zilliz 2023 秋季校园招聘正式启动!
Recognized by International Authorities | Yunzhuang Technology was selected in "RPA Global Market Pattern Report, Q3 2022"
密码学基础以及完整加密通讯过程解析
走迷宫 BFS
举一个 web worker 的例子
utils 定时器
log4j-slf4j-impl cannot be present with log4j-to-slf4j
Interpretation of ML: A case of global interpretation/local interpretation of EBC model interpretability based on titanic titanic rescued binary prediction data set using interpret
2022-08-03 Oracle executes slow SQL-Q17 comparison
utlis 线程池
响应式织梦模板除尘器类网站
HCIP BGP实验报告
BMN: Boundary-Matching Network for Temporal Action Proposal Generation阅读笔记
为什么我们需要回调
牛客2022 暑期多校3 H Hacker(SAM + 线段树查询区间内部最大子段和)
Lift, Splat, Shoot: Encoding Images from Arbitrary Camera Rigs by Implicitly Unprojecting to 3D 论文笔记