Forum Moderators: open

Message Too Old, No Replies

Validator errors still passing

but I'm a perfectionist

         

Sypher_5

11:02 am on Feb 10, 2004 (gmt 0)

10+ Year Member



Here's the part that's getting caught up all over the page.

<img src='images/newtile.gif' alt='C1 - C4' class='mseo' onmouseover="EnterContent('ToolTip','C1 - C4','<img src=lunar/c1c4.gif />'); Activate();" onmouseout="deActivate()" />

I have a javascript that creates a tooltip in a floating div and displays an image, all very nice and keeps alot of work away from my poor tired eyes, and nasty popups from flooding the screen. Even better is the images dont load till mouseover so I can link to heaps of images and not have to worry about load times for the page.

Here's the error.

"<" is the first character of a delimiter but occurred as data

Is there anyway to get past this small error? It still passes as XHTML so I'm not too worried I'd just like it to be 100% perfect.

I haven't tried using ascii codes for the angle bracket but I didn't think it'd work.

If there's no alternative I'm fine with it :)

--- Thought that just popped into my head as I've been typing this, I wonder if I could move the "<img>" tag section to the script and just use the images name as the varible... --- Thinking on the run again, any ideas or comments welcome, will report back my findings when I get time to try my new idea out.

dcrombie

12:13 pm on Feb 10, 2004 (gmt 0)



I'd follow that last thought - worst case is that you end up with one parse error instead of many.

DrDoc

4:09 pm on Feb 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, just make the image name a variable. That's your best bet :)

g1smd

9:35 pm on Feb 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Remember to escape the / in any closing tags by preceding it with a \ each time too.

So </a> becomes <\/a> and so on.

Purple Martin

11:03 pm on Feb 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



An alternative to escaping closing tags is to split the string:

var myString = "<" + "/a>";

This will also validate.