From:
http://www.site.com/example/index.html
How can I get just:
http://www.site.com/example/
And storing it into a variable using Javascript and how using jQuery also. Thanks in advance.
var myURL = "http://www.site.com/example/index.html"; var myDir = myURL.substring( 0, myURL.lastIndexOf( "/" ) + 1);
1.4m articles
1.4m replys
5 comments
57.0k users