Help needed with 'window.location.href'


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Help needed with 'window.location.href'

  1. #1
    Join Date
    Feb 2003
    Posts
    1

    Help needed with 'window.location.href'

    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 www.mimi.ch
    it will say 'Welcome to Mimi'
    display 'http://www.mimi.ch'
    and create an email address as 'info@mimi.ch'.

    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

  2. #2
    Join Date
    Jul 2002
    Posts
    60
    Hello,
    You have an interesting question; unfortunately it involves javaSCRIPT which is different from JAVA. This is a discussion list about the programming language Java.
    Internet.com does have one for JavaScript located at:
    http://www.javascript.com

    You may wish to post your question there so that those experienced and interested in Javascript can respond to your question there.

    Thanks,

    Jim Menees

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center