Welcome to WebmasterWorld Guest from 107.21.183.163

Forum Moderators: incrediBILL

Message Too Old, No Replies

Validate last 3 errors?

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

     

mattapp

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



Hello,

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!

Errors:

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" />'
});
});

</script>



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

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

topr8

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

WebmasterWorld Senior Member topr8 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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?

swa66

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

WebmasterWorld Senior Member swa66 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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.

phranque

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

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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]

Fotiman

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

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



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.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month