Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Mar 2009
    Posts
    88
    Thanks
    10
    Thanked 0 Times in 0 Posts

    document.getElementById('MyLink').href is this possible?

    I wonder if this is possible, the document.getElementById('MyLink').href I mean. At first sight it doesn't work, but maybe I did something wrong with the quotes or something.

    Any help would be great
    Code:
    <script type="text/javascript">
    
    function changeLink()
    {
    document.getElementById('MyLink').innerHTML="Bookmark me!";
    document.getElementById('MyLink').href="javascript:document.write('<html><head><title>{$txt_short_url}</title></head><body><form name=\'urlform\' action=\'{$short_url}\' method=\'post\'><input type=\'hidden\' name=\'u\' value=\'' + window.location.href + '\' /></form></body></html>');document.forms[0].submit()";
    document.getElementById('MyLink').target="_blank";
    }
    </script>
    
    
    <body onload changeLink();>
    
    <a id="MyLink" href="http://www.JustaLink.com">Just A Link</a>

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,853
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Code:
    onload="changeLink();"
    btw, let me ask, what's your ultimate goal?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    boemboem (06-20-2009)

  • #3
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,011
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    Quote Originally Posted by abduraooft View Post
    Code:
    onload="changeLink();"
    btw, let me ask, what's your ultimate goal?
    Joost mag het weten.

  • Users who have thanked Philip M for this post:

    boemboem (06-20-2009)

  • #4
    New Coder
    Join Date
    Mar 2009
    Posts
    88
    Thanks
    10
    Thanked 0 Times in 0 Posts
    Philip, beetje ver van huis vriend Won je in London of spoof je dat

    In this way I want to thank everyone for making my goals possible.

    @ Philip, Kor and ofcourse tomws

    This is what I wanted to do, and with all your help I managed to do so.

    http://twiturl.nl (notice the image in top of the page )

    The only thing now is the different placement of the div's in Iexplorer, but that's an other department in CodingForums.

    Thank you'll

  • #5
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,011
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    Quote Originally Posted by boemboem View Post
    Philip, beetje ver van huis vriend Won je in London of spoof je dat
    Eigenlijk woon ik in een mooie buitenwijk ongeveer 50km van London. Vroeger heb ik in Nederland en Belgie enkele jaren gewerkt.
    Last edited by Philip M; 06-20-2009 at 11:57 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •