当前位置:网站首页>location search 属性获取登录用户名
location search 属性获取登录用户名
2022-07-05 08:43:00 【王小婷】
定义和用法
search 属性是一个可读可写的字符串,可设置或返回当前 URL 的查询部分(问号 ? 之后的部分)。 语法
location.search现在要获取 username=mote 获取到mote即可
打开浏览器的控制台 输入
location search可以获取链接?后面的部分
然后对获取到的字符串进行分割处理
定义和用法:split() 方法用于把一个字符串分割成字符串数组。再从数组里面取到自己想要的下标值即可
location.search.split("=")[1]
边栏推荐
- Halcon wood texture recognition
- 287. Looking for repeats - fast and slow pointer
- 【日常訓練--騰訊精選50】557. 反轉字符串中的單詞 III
- 【日常训练--腾讯精选50】557. 反转字符串中的单词 III
- 资源变现小程序添加折扣充值和折扣影票插件
- golang 基础 —— golang 向 mysql 插入的时间数据和本地时间不一致
- Reasons for the insecurity of C language standard function scanf
- Run菜单解析
- 剑指 Offer 06. 从尾到头打印链表
- Wheel 1:qcustomplot initialization template
猜你喜欢
随机推荐
Matlab tips (28) fuzzy comprehensive evaluation
[three tier architecture and JDBC summary]
Run menu analysis
Dynamic dimensions required for input: input, but no shapes were provided. Automatically overriding
Meizu Bluetooth remote control temperature and humidity access homeassistant
Example 005: three numbers sorting input three integers x, y, Z, please output these three numbers from small to large.
猜谜语啦(8)
Agile project management of project management
Search data in geo database
【日常訓練--騰訊精選50】557. 反轉字符串中的單詞 III
Business modeling of software model | vision
Halcon: check of blob analysis_ Blister capsule detection
[daily training] 1200 Minimum absolute difference
多元线性回归(sklearn法)
如何写Cover Letter?
Arduino operation stm32
Meta标签详解
Basic number theory - fast power
Typical low code apaas manufacturer cases
剑指 Offer 09. 用两个栈实现队列









