您的位置:首页 > Web前端 > JavaScript

js搞定域名包含工程名,测试环境生产环境访问url不一样

2016-11-27 21:04 621 查看
window.location.protocol+'//'+window.location.hostname+(window.location.port?':'+window.location.port:'')+(/http(s)?:\/\/[^\/]+\/([^\/:]+)\//.test(window.top.location.href)?('/'+RegExp.$2):'')

var href = window.location.protocol+'//'+window.location.hostname+(window.location.port?':'+window.location.port:'')+(/http(s)?:\/\/[^\/]+\/([^\/:]+)\//.test(window.top.location.href)?('/'+RegExp.$2):'')
+'/acc.do?' +
'id=' + p.id;

window.open(href, '_blank');
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐