1var url,foldersAndFile,folders,folderpath,protocol,host,ourLocation;
2 url = window.location;
3
4 foldersAndFile = url.pathname.split("/");
5 folders = foldersAndFile.slice(0,foldersAndFile.length-1);
6 folderpath = folders.join("/");
7
8 protocol = url.protocol+"//";
9 host = url.host;
10
11 ourLocation=protocol+host+folderpath;
12
13 return ourLocation;// http://google.com/search