Advertisement
Guest User

Untitled

a guest
Aug 21st, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. var myURL = "http://www.site.com/example/index.html";
  2. var myDir = myURL.substring( 0, myURL.lastIndexOf( "/" ) + 1);
  3.  
  4. var s1 = "http://www.site.com/example/index.html";
  5. var s2 = s1.replace(s1.split("/").pop(),"");
  6.  
  7. var a = "http://www.site.com/example/index.html";
  8. var b = a.substring(0, a.lastIndexOf('/'))+"/";
  9.  
  10. var url = "http://www.site.com/example/index.html";
  11. var newUrl = url.match(/^(.*[\/])/)[1];
  12.  
  13. $(location).prop("href").split("/").slice(0,-1).join("/")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement