当前位置:网站首页>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
边栏推荐
- RPA助力商超订单自动化!
- With the rise of concepts such as metaverse and web3.0, many digital forms such as digital people and digital scenes have begun to appear.
- "Digital Economy Panorama White Paper" Financial Digital User Chapter released!
- MiniAPI of .NET6 (14): Cross-domain CORS (Part 1)
- navicat 连接 mongodb 报错[13][Unauthorized] command listDatabases requires authentication
- 【LeetCode】最长公共子序列(动态规划)
- 3D 语义分割——2DPASS
- IELTS essay writing template
- What is memoization and what is it good for?
- UVa 1025 - A Spy in the Metro (White Book)
猜你喜欢

override learning (parent and child)

Quickly build a website with static files

Redis persistence method

BMN: Boundary-Matching Network for Temporal Action Proposal Generation阅读笔记

栈的压入、弹出序列

Pytest学习-setup/teardown

获国际权威认可 | 云扩科技入选《RPA全球市场格局报告,Q3 2022》

Summary bug 】 【 Elipse garbled solution project code in Chinese!

重发布实验报告

密码学基础以及完整加密通讯过程解析
随机推荐
走迷宫 BFS
【开源框架】国内首个通用云计算框架,任意程序都可做成云计算。
【day1】
【RYU】rest_router.py源码解析
Deep integration of OPC UA and IEC61499 (1)
二叉搜索树解决落叶问题
Websocket multi-threaded sending message error TEXT_PARTIAL_WRITING--Use case of spin lock replacing synchronized exclusive lock
响应式织梦模板餐饮酒店类网站
藏宝计划TreasureProject(TPC)系统模式开发技术原理
【LeetCode】最长回文子序列(动态规划)
win10系统下yolov5-V6.1版本的tensorrt部署细节教程及bug修改
HCIP BGP lab report
Work Subtotal QT Packing
Summary bug 】 【 Elipse garbled solution project code in Chinese!
响应式织梦模板塑身瑜伽类网站
complete binary tree problem
RPA助力商超订单自动化!
密码学基础以及完整加密通讯过程解析
The salary of soft testers at each stage, come to Kangkang, how much can you get?
Creo 9.0创建几何点