Print URL in a input tag
I have a form, with one input to be set to the directory of the current page.
Real URL: http://www.site.com/folder/dir/page.html
What I want printed: http://www.site.com/folder/dir/
Can anyone give me a script, or point me in the right direction.
This is pretty basic, and assumes that you have no / in your querystring.
var a = new String(window.location);
var b = a.split("/");
var c = b.pop();
var d = b.join("/");
Thanks for your help, I have got the code all working for my site now.