Click to See Complete Forum and Search --> : is there a way to get the url withought the page name?


pelegk1
12-21-2003, 01:19 AM
is there a function that gives the url
withought the page name :
http://localhost/1.index
and i want just
http://localhost/

thanks
peleg

fredmv
12-21-2003, 01:26 AM
<script type="text/javascript">
//<![CDATA[
alert(location.href.substring(0, location.href.lastIndexOf('/')+1));
//]]>
</script>

pelegk1
12-21-2003, 01:38 AM
i wasnt aware of the lastindex function
but good to know

fredmv
12-21-2003, 01:43 AM
You're quite welcome. You learn something new every day, right? :D

pelegk1
12-21-2003, 02:20 AM
and u 2 man