Welcome to WebmasterWorld Guest from 54.147.63.124

Forum Moderators: incrediBILL

Message Too Old, No Replies

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 User

joined:July 27, 2012
posts: 1
votes: 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]
8:31 pm on July 27, 2012 (gmt 0)

Senior Member

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

joined:Apr 19, 2002
posts:3171
votes: 8


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 July 28, 2012 (gmt 0)

Senior Member

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

joined:Aug 7, 2003
posts:4783
votes: 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 July 29, 2012 (gmt 0)

Administrator

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

joined:Aug 10, 2004
posts:10544
votes: 8


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 July 30, 2012 (gmt 0)

Senior Member from US 

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

joined:Oct 17, 2005
posts: 4966
votes: 10


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.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members