开发者

Get url with javascript

I want to get the url with javascript. But I just need http://www.mysite.com, without any parameters beh开发者_开发问答ind it. any idea how to get that?


Use this:

var url = window.location.protocol + "//" + window.location.host;


window.location.hostname


try

window.location.protocol+'//'+window.location.hostname
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜