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
精彩评论