Code will not validate wc3

Hello, I am currently creating a website and I know that my code will not validate wc3 … I wish I could fix it now before putting my site online. This is a rollover on picture.

My code source:

<img style="border: 0px solid ; width: 120px; height: 110px;"
 src="images/smartybubblesteaser.png"ALT="Jeu Smarty Bubbles"
 onmouseover="this.src='images/jouer.jpg'"ALT="Jeu Smarty Bubbles"
onmouseout="this.src='images/smartybubblesteaser.png'"ALT="Jouer à Petite Marie les zombies" >

it’s very difficult for me to understand, and that’s why I ask for your help … and hello from France;)
Thank you :slight_smile:

Hi gwenm,

Welcome to the forum.

Is it possible to upload the offending page to your site, call it something like “test.html” and supply the link?

thank you very much for your help. I downloaded one of my sites on this page http://big-jeux.com/test.html. Is would this help?

Hi gwenm,

Many thanks for uploading the file it makes validation a lot simpler.

Here is a link which shows all the errors and warnings, quite a few are quite simple to fix such as:

  1. duplicate image alt attribute - Only one alt attribute per image is allowed.

  2. no space between attributes. - No spaces allowed between atributes.

  3. Article lacks heading. - Page requires heading.

Please fix these errors and Google for solutions for other errors. If you have any specific problems then please feel free to ask and explain what steps you have made to eliminate the error (so we do not have to repeat what you have already done :slight_smile:

Off Topic:

I am off to bed for an early night because tomorrow is Launch Day for the New SitePoint Forum!!!

1 Like

ok, I do not really understand …

  1. duplicate image alt attribute : if I deleted ("alt=“Jouer Smarty Bubbles”), it gives another error

  2. no space between attributes: I do not see space

I tested another page http://big-jeux.com/teste2.html ;), it is almost valid, but I can not encode properly. I tried encode ansi, UTF8, and UTF8 (without boom)

The first " there does not belong with the alt attribute, but with the preceding src declaration - hence deleting it will create a different error.

That’s the problem. :slight_smile:

&lt;img style="border: 0px solid ; width: 120px; height: 110px;"
 src="images/smartybubblesteaser.png"alt="Jeu Smarty Bubbles"
 onmouseover="this.src='images/jouer.jpg'"
onmouseout="this.src='images/smartybubblesteaser.png'&gt;

second line is missing a space and should read

 src="images/smartybubblesteaser.png" alt="Jeu Smarty Bubbles"

You’re also missing the closing quotes on the fourth line. Should be

onmouseout="this.src='images/smartybubblesteaser.png'"

Thank you TechnoBear, look, I almost succeeded http://big-jeux.com/test.html. I have one error :

 Byte-Order Mark found in UTF-8 File.

The Unicode Byte-Order Mark (BOM) in UTF-8 encoded files is known to cause problems for some text editors and older browsers. You may want to consider avoiding its use until it is better supported. 

You’re using a non-standard doctype declaration. If you really intend it to be HTML4 transitional (which is pretty outdated now), then it should be

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

Otherwise, use HTML4 strict:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">

or HTML5

<!DOCTYPE HTML>

You should also include the character encoding:

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

I suspect the Byte Order Mark is being inserted by your editor. which one are you using?

Hello, I use notepad ++ :wink:

I’ve never used Notepad++, but a quick search suggests the thing to do is to choose the “Encode in UTF-8 without BOM” option. (See the first reply here: http://stackoverflow.com/questions/291455/xml-data-at-root-level-is-invalid) If that doesn’t work, you’ll need to wait for somebody who uses Notepad++. :slight_smile:

Ok, what editor are you using ?

Bluefish (on Linux - but it is available for other platforms, too).

Thank you :wink:

I finally took my initial code and corrected the errors … it’s much better http://validator.w3.org/check?uri=http%3A%2F%2Fbig-jeux.com%2Findextest.html;ss=1;st=1;outline=1;No200=1;verbose=1 :wink:

Hi Gwenm,

You may be interested in the following FireFox Addon that shows either a green or red icon in the browser immediately after the Firefox has displayed the web=page. Green and red for valid HTML and red with errors.
Clicking on the icon shows three panels, source code, errors and a help. Using this unobtrusive Firefox Addon will save you time.

[        https://addons.mozilla.org/en-US/fir...ueury/?src=api     ](https://addons.mozilla.org/en-US/fir...ueury/?src=api)

Also here is your script using the STRICT Doctype:

http://www.johns-jokes.com/downloads/sp-c/validation-gwenm/

Thank you very much, the first link “Firefox” is invalid, and it really interest me;)

What is the difference between the codes?

<script type="text/javascript">
	/*  The code below cannot be used together, use solution 1 or solution 2  */
	//  Solution 1
	$(document).ready(function(){
		$('A[rel="_blank"]').each(function(){
		    $(this).attr('target', '_blank');
		});
	}); </script>
<script type="text/javascript">//  Solution 2
	$(document).ready(function(){
	    $('A[rel="_blank"]').click(function(){
	        window.open($(this).attr('href'));
	        return false;
	    });
	});
</script>

Whoops, sorry about the link, I did check it and don’t know why it is not correct.

Try this:

I do not know the JavaScript differences. Opening a new thread in the JavaScript forum would be a better place to ask your questions.

1 Like

I download it ! Thank you very much for your support that has allowed me to avancer…vous all very nice!