amin7b5 Posted September 4, 2008 Share Posted September 4, 2008 I am new to Javascript and I downloaded OverLIB for some interesting mouseover effects. I try to build all of my pages so that they will validate on W3C and although the OverLIB script is working fine, the markup to instantiate the mouseover simply will not validate, i think because I'm placing html tags within tags. Here is an example: <a href="javascript:void(0);" onmouseover="return overlib('<img src=\'images/latest_work/aos.jpg\' alt=\'Advanced Overlay Systems\' /><br /><p>This is a little caption box displaying an image and some text.', STICKY, CAPTION, 'Advancedoverlay.com', MOUSEOFF);" onmouseout="return nd();"><img src="images/latest_work/aos.jpg" alt="Advanced Overlay Systems" /></a> If there is anyway to get this markup to validate, I'd love to find out! I wasn't sure if this belongs in the javascript or html forum, but since it involves a script I figured I'd start here. Thanks in advance to any help. Quote Link to comment Share on other sites More sharing options...
haku Posted September 4, 2008 Share Posted September 4, 2008 What is the error that it is throwing up? Quote Link to comment Share on other sites More sharing options...
amin7b5 Posted September 4, 2008 Author Share Posted September 4, 2008 Here's all seven errors from the validator! # Line 41, Column 62: XML Parsing Error: Unescaped '<' not allowed in attributes values. …id(0);" onmouseover="return overlib('<img src=\'images/latest_work/aos.jpg\' ✉ # Error Line 41, Column 62: XML Parsing Error: attributes construct error. …id(0);" onmouseover="return overlib('<img src=\'images/latest_work/aos.jpg\' ✉ # Error Line 41, Column 62: XML Parsing Error: Couldn't find end of Start Tag a line 41. …id(0);" onmouseover="return overlib('<img src=\'images/latest_work/aos.jpg\' ✉ # Error Line 41, Column 71: XML Parsing Error: AttValue: " or ' expected. …nmouseover="return overlib('<img src=\'images/latest_work/aos.jpg\' alt=\'Adv ✉ # Error Line 41, Column 71: XML Parsing Error: attributes construct error. …nmouseover="return overlib('<img src=\'images/latest_work/aos.jpg\' alt=\'Adv ✉ # Error Line 41, Column 71: XML Parsing Error: Couldn't find end of Start Tag img line 41. …nmouseover="return overlib('<img src=\'images/latest_work/aos.jpg\' alt=\'Adv ✉ # Error Line 41, Column > 80: XML Parsing Error: Opening and ending tag mismatch: div line 37 and a. …r="return overlib('<img src=\'images/latest_work/aos.jpg\' alt=\'Advanced Ove… Quote Link to comment Share on other sites More sharing options...
haku Posted September 4, 2008 Share Posted September 4, 2008 Replase all of these: < with this: < and replace all these: > with this: > That will solve some of your errors, maybe even all of them (if not, post the new/remaining errors after doing this). There is also the possibility your code won't work after doing this, though I think it should. If it doesn't work after making these changes, then you will have to revert back to the way it was before, and move your javascript to external files (which I personally prefer anyways). Quote Link to comment Share on other sites More sharing options...
amin7b5 Posted September 4, 2008 Author Share Posted September 4, 2008 Hey, that did the trick! Thank you so much! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.