<a href="#" ...> not handled as link

Dawit A. adawit at kde.org
Fri Oct 15 09:32:25 BST 2004


On Thursday 14 October 2004 19:34, David Faure wrote:
> On Friday 15 October 2004 01:27, André Wöbbeking wrote:
> > Funny, with trailing / I get no link and onClick doesn't work. But wait,
> > I used
> >
> > <html>
> >   <body>
> >     <a href="#" onClick="window.open('http://www.kde.org')"/>Text</a>
> >   </body>
> > </html>
> >
> > Without <body> tags it works as you described.
>
> Indeed. The body tag makes a difference. Unbelievable :)
> Now this is a job for someone who knows htmltokenizer...

I have have a problem with a very similar issue on my web banking site. There 
they have invalid HTML constructs as follows:

<html>
<font color="#0000ff">
  <a href="javascript:alert('Hello World!')"/>
  <big>Click Here</big>
</font>
</html>

After reading this thread I further investigated and it seems that the invalid 
anchor construct will not work if it is contained within any other inline and 
block level element (not just <body>) where as it works fine when it is not. 
For example, the following works fine:

<html>
<a href="javascript:alert('Hello World!')"/>
<font color="#0000ff">
<big>Click Here</big>
</font>
</html>

-- 
Regards,
Dawit A.
"Preach what you practice, practice what you preach"




More information about the kfm-devel mailing list