Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var myURL = "http://www.site.com/example/index.html";
- var myDir = myURL.substring( 0, myURL.lastIndexOf( "/" ) + 1);
- var s1 = "http://www.site.com/example/index.html";
- var s2 = s1.replace(s1.split("/").pop(),"");
- var a = "http://www.site.com/example/index.html";
- var b = a.substring(0, a.lastIndexOf('/'))+"/";
- var url = "http://www.site.com/example/index.html";
- var newUrl = url.match(/^(.*[\/])/)[1];
- $(location).prop("href").split("/").slice(0,-1).join("/")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement