Help needed with 'window.location.href'

wxdqz

New Member
Hi Everybody,
I am trying to create a webpage which will automatically pick the url , the domian name and create an email address. For example:
If i put my page on <!-- w --><a class="postlink" href="http://www.mimi.ch">www.mimi.ch</a><!-- w -->
it will say 'Welcome to Mimi'
display 'http://www.mimi.ch'
and create an email address as <!-- e --><a href="mailto:'[email protected]">'[email protected]</a><!-- e -->'.

I was told that i could use 'window.location.href' and found a script which lets me display 'http://www.mimi.ch' .

<script type="text/javascript">
var myloc = window.location.href;
var locarray = myloc.split("/");
delete locarray[(locarray.length-1)];
var arraytext = locarray.join("/");
document . write ('"<tt>' + arraytext + '</tt>."');
</script>

Now being new to Java, how do I do the other two.
Can anybody help me.

Thanking in advance,

C Dhanjal
 
Back
Top