What happens when you you have an http:// in there?

Your href should never just be www.somedomain.com anyway as that will
attempt to load that as a document in the current domain's directory
structure.


andy 

-----Original Message-----
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of weepy
Sent: Tuesday, January 15, 2008 10:49 AM
To: jQuery (English)
Subject: [jQuery] [OFF TOPIC] Really weird Behaviour in IE


I just found the oddest behaviour in IE6.

If you have an <a> tag with content that is a domain name e.g. :

   <a href='www.google.com'>www.google.com</a>

if you set the href attribute (via jquery or natively) to another domain
name - it will change the innerHTML to reflect this.

E.G.
   $('a').attr("href", "www.yahoo.com")

will turn this into

   <a href='www.yahoo.com'>www.yahoo.com</a>

If the innerHTML is not a domain. then it won't do this.

You can see that the IE programmers we obviously trying to do something
helpful here - but too much magic is a bad thing : just wasted 1/2 an hour
on this .

Jonah


Reply via email to