Re: Dynamic update of href.
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: Dynamic update of href.

From: Aaron Gray <ang.usenet@gmail.com>
Date: Thu Nov 17 2005 - 19:03:55 CET

>> I'm constructing a web page that previews data as it is entered by the
>> user. One of the fields is a link, and the user is entering the url
>> that will go in the href property. I'd like to update the href of the
>> previewed link as the user enters the url text. I.e. dynamically
>> update the href.
>> I can't see how to do this. Is it possible?
>
>
> <input onkeyup="z=document.getElementById('link');
> z.innerHTML=z.href=this.value;" value='http://'>
> <br>
> <a href='http://' id='link'>http://</a>
>
>> Assuming IE6.
>
> Why?

Here's a fun one :)

    <input onkeyup="z=window.frames['page'].location.href=this.value;"
value='http://'>
    <iframe width=100% height=90% name="page"></iframe>

Aaron
Received on Mon Nov 21 03:32:49 2005