方法:
window.location.href = prefixURL+'webstatic/messageAnalysis/datadetail.html?id=' + num + "&time=" + time+"&authKey="+this.authKey
getUrlArgs: function () {
const query = location.search.substring(1);
const pairs = query.split('&');
let args = {};
let pos;
let idx;
let argname;
let val;
for (var i = 0; i < pairs.length; i++) {
pos = pairs[i];
idx = pos.indexOf('=');
if (idx == -1) continue;
argname = pos.substring(0, idx);
val = decodeURIComponent(pos.substring(idx + 1));
args[argname] = val;
}
return args;
},
 
方法调用:
获取url后面对应的参数名称
 
let urlArgs = globalFunc.getUrlArgs();
this.authKey = urlArgs.authKey;
 

获取页面url信息的更多相关文章

  1. Javascrip获取页面URL信息

    使用Javascript可以方便获得页面的参数信息,常用的几种如下: 设置或获取对象指定的文件名或路径 window.location.pathname   设置或获取整个 URL 为字符串 wind ...

  2. JS获取页面URL信息

    下面我们举例一个URL,然后获得它的各个组成部分: http://i.cnblogs.com/EditPosts.aspx?opt=1 window.location.href (设置或获取整个 UR ...

  3. js获取页面url的方法

    我们可以用javascript获得其中的各个部分 1, window.location.href 整个URl字符串(在浏览器中就是完整的地址栏) 本例返回值: http://ifisker.com/b ...

  4. js获取当前页面url信息

    <html> <head> <meta charset="utf-8" /> <title></title> <s ...

  5. js获取当前页面url信息方法(JS获取当前网址信息)

    设置或获取对象指定的文件名或路径. alert(window.location.pathname) 设置或获取整个 URL 为字符串. alert(window.location.href); 设置或 ...

  6. js 获取当前URL信息

    document.location 这个对象包含了当前URL的信息 location.host 获取port号 location.hostname 设置或获取主机名称 location.href 设置 ...

  7. js获取页面url中的各项值

    一. 通过window.location获取各项参数 1.获取页面完整的url url = window.location.href; 2.获取页面的域名 host = window.location ...

  8. js获取当前url信息

    window.location 属性 描述 hash 设置或获取 href 属性中在井号"#"后面的分段. host 设置或获取 location 或 URL 的 hostname ...

  9. C#取得页面URL信息

    我們在開發網頁應用程式,時常需要去解析網址(Request.Url)的每個片段,進行一些判斷.例如說 "http://localhost:1897/News/Press/Content.as ...

随机推荐

  1. 【D3D12学习手记】The Swap Chain and Page Flipping

    为了避免动画中的闪烁,最好将整个动画帧绘制到称为后台缓冲区的屏幕外纹理(off-screen texture)中.一旦整个场景被绘制到给定动画帧的后缓冲区,它就作为一个完整的帧呈现给屏幕;以这种方式, ...

  2. [转] 运维知识体系 -v3.1 作者:赵舜东(赵班长)转载请注明来自于-新运维社区:https://www.unixhot.com

    [From]https://www.unixhot.com/page/ops [运维知识体系]-v3.1 作者:赵舜东(赵班长) (转载请注明来自于-新运维社区:https://www.unixhot ...

  3. 仿flash运动框架

    github地址: [https://github.com/linxd5/pictureShow] PS: 新建一个github项目很简单,只要new一个repo,后面按照提示做就可以了~ 项目思路: ...

  4. Linux (Ubuntu 18.04) 安装vim编辑器

    大家可以去Ubuntu官网下载桌面系统:https://ubuntu.com/download/desktop,虽然最新版是19.04,但是建议大家下载稳定版18.04.安装过程非常简洁,我使用的是V ...

  5. 【HANA系列】SAP HANA SQL条件判断是NULL的写法

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[HANA系列]SAP HANA SQL条件判断 ...

  6. 华为HCNA乱学Round 4:RIP

  7. springboot_redis

    1.引入redis的启动器 <dependency> <groupId>org.springframework.boot</groupId> <artifac ...

  8. Java字节流文件封装

     /**  * 字节流封装方法  */ import java.io.FileInputStream; import java.io.FileNotFoundException; import jav ...

  9. splite与join

    Python split() 通过指定分隔符对字符串进行切片 切片之后为list数据类型. sentence = 'I can because I think I can ' s_1 = senten ...

  10. SqlServer中插入数据后如何得到主键ID

    使用@@IDENTITY 例如:insert into student(name,age) values('fanqi',23) select @@identity 使用 OUTPUT inserte ...