当前位置:网站首页>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
边栏推荐
猜你喜欢

禾匠编译错误记录

node连接mysql数据库报错:Client does not support authentication protocol requested by server

ML之yellowbrick:基于titanic泰坦尼克是否获救二分类预测数据集利用yellowbrick对LoR逻辑回归模型实现可解释性(阈值图)案例

The salary of soft testers at each stage, come to Kangkang, how much can you get?

V8中的快慢数组(附源码、图文更易理解)

设置工作模式与环境(下):探查和收集信息
![[Paper Reading] TRO 2021: Fail-Safe Motion Planning for Online Verification of Autonomous Vehicles Using Conve](/img/17/342676e20fc04ce9083c5ed443bc1d.png)
[Paper Reading] TRO 2021: Fail-Safe Motion Planning for Online Verification of Autonomous Vehicles Using Conve

Fluorescein-PEG-CLS,胆固醇-聚乙二醇-荧光素科研试剂

Redis persistence method

Cloud platform construction solutions
随机推荐
Storage engine written by golang, based on b+ tree, mmap
图论-虚拟节点分层建图
1067 Sort with Swap(0, i)
数据分析知识点搜集(纯粹的搜集)
Websocket multi-threaded sending message error TEXT_PARTIAL_WRITING--Use case of spin lock replacing synchronized exclusive lock
【并发编程】ReentrantLock的lockInterruptibly()方法源码分析
complete binary tree problem
冰河又一MySQL力作出版(文末送书)!!
剑指offer第22题-链表中倒数第K个节点
Walk the Maze BFS
Analysys Analysis: The transaction scale of China's online retail B2C market in Q2 2022 will reach 2,344.47 billion yuan
为什么我们需要回调
The principle and use of AOSP CameraLatencyHistogram
log4j-slf4j-impl cannot be present with log4j-to-slf4j
Pytest learn-setup/teardown
Kotlin - extension functions and operator overloading
Canvas App中点击图标生成PDF并保存到Dataverse中
encapsulation, package, access modifier, static variable
直播预告 | 构建业务智联,快速拥抱财务数字化转型
伴随着元宇宙、web3.0等概念的兴起,数字人、数字场景等诸多数字化的形态开始出现