homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

Validate last 3 errors?
Need to validate the last remaining errors regarding my e-commerce website.

 7:43 pm on Jul 27, 2012 (gmt 0)


New to the forums, been browsing for a while and learn't a vast amount already. I have 2 errors that i am trying to validate and i just can't seem to get my head around them and solve them!


Line 357, Column 159: document type does not allow element "img" here

Line 358, Column 156: document type does not allow element "img" here

Code from line 349:

<script type="text/javascript">

jQuery(document).ready(function() {
jQuery('#featured ul').jcarousel({
wrap: 'both',
animation: 1000,
visible: 1,
scroll: 1,
auto: 5,
buttonNextHTML: '<img class="button-right" src="http://www.example.com/skin/frontend/default/magesupport/images/btn_rght_arrow.gif" alt="Right Arrow" />',
buttonPrevHTML: '<img class="button-left" src="http://www.example.com/skin/frontend/default/magesupport/images/btn_lft_arrow.gif" alt="Left Arrow" />'


Any help would be greatly appreciated, many thanks for your time.

[edited by: tedster at 8:08 pm (utc) on Jul 27, 2012]



 8:31 pm on Jul 27, 2012 (gmt 0)

this is presumably in the html <head>, where an image element would not be allowed.

however as this is part of a javascript, then i assume the validator you are using is not working properly as it thinks there is an image element in the head.

... i assume the javascript is working as expected on the page?


 12:02 am on Jul 28, 2012 (gmt 0)

Not familiar with the jquery itself, but

- either comment the script itself out (old style)

- Or better yet: use htmlentities &lt; and &gt; instead of < and > in the strings in your script.


 2:51 am on Jul 29, 2012 (gmt 0)

welcome to WebmasterWorld, mattapp!

check out the part at the end where mattur and Fotiman geek about properly handling html in javascript in (x)html(5):
http://www.webmasterworld.com/javascript/4125778.htm [webmasterworld.com]


 2:33 pm on Jul 30, 2012 (gmt 0)

Heard my name mentioned... ;)
Yeah, I was just about to chime in and say that this is easily solved by moving the script to an external file. Better for caching, better for separation of content/behavior, and better for validation purposes.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved