PDA

View Full Version : validating error - onload attribute


mazer
03-14-2006, 03:04 PM
I'm trying to validate all the pages on my site as XHTML 1.0 Transitional but I don't know much javascript so I'm totally stuck on this error:
The tag: "img" doesn't have an attribute: "onload" in currently active versions.[XHTML 1.0 transitional]
can anyone help me rewrite this, any help would be greatly appreciated.
I marked the "onload attribute" in red

<table border=0 cellspacing=1 cellpadding=0 width=195>
<TR VALIGN=TOP ALIGN=LEFT>
<TD WIDTH=195 HEIGHT=30><A HREF="./html/mcfarlane_figures.asp" onMouseOver="F_roll('NavigationButton2',1)" onMouseOut="F_roll('NavigationButton2',0)"><IMG ID="NavigationButton2" NAME="NavigationButton2" HEIGHT=25 WIDTH=170 SRC="./assets/images/autogen/McFarlane_Figures_Np1b.gif" onLoad="F_loadRollover(this,'McFarlane_Figures_NRp2.gif',0)" BORDER=0 ALT="McFarlane Figures"></A></TD>
</TR>
<TR VALIGN=TOP ALIGN=LEFT>
<TD WIDTH=195 HEIGHT=30><A HREF="./html/magic_the_gathering.asp" onMouseOver="F_roll('NavigationButton3',1)" onMouseOut="F_roll('NavigationButton3',0)"><IMG ID="NavigationButton3" NAME="NavigationButton3" HEIGHT=25 WIDTH=170 SRC="./assets/images/autogen/Magic_the_Gathering_Np1b.gif" onLoad="F_loadRollover(this,'Magic_the_Gathering_NRp2.gif',0)" BORDER=0 ALT="Magic The Gathering Cards"></A></TD>
</TR>
<TR VALIGN=TOP ALIGN=LEFT>
<TD WIDTH=195 HEIGHT=30><A HREF="./html/news_and_reviews.asp" onMouseOver="F_roll('NavigationButton4',1)" onMouseOut="F_roll('NavigationButton4',0)"><IMG ID="NavigationButton4" NAME="NavigationButton4" HEIGHT=25 WIDTH=170 SRC="./assets/images/autogen/News_and_Reviews_Np1b.gif" onLoad="F_loadRollover(this,'News_and_Reviews_NRp2.gif',0)" BORDER=0 ALT="Comic News and Reviews"></A></TD>
</TR>
<TR VALIGN=TOP ALIGN=LEFT>
<TD WIDTH=195 HEIGHT=30><A HREF="./html/publishers.asp" onMouseOver="F_roll('NavigationButton5',1)" onMouseOut="F_roll('NavigationButton5',0)"><IMG ID="NavigationButton5" NAME="NavigationButton5" HEIGHT=25 WIDTH=170 SRC="./assets/images/autogen/Publishers_Np1b.gif" onLoad="F_loadRollover(this,'Publishers_NRp2.gif',0)" BORDER=0 ALT="Comic Publishers"></A></TD>
</TR>
<TR VALIGN=TOP ALIGN=LEFT>
<TD WIDTH=195 HEIGHT=30><A HREF="./html/Contact_Us.html" onMouseOver="F_roll('NavigationButton6',1)" onMouseOut="F_roll('NavigationButton6',0)"><IMG ID="NavigationButton6" NAME="NavigationButton6" HEIGHT=25 WIDTH=170 SRC="./assets/images/autogen/Contact_Np1b.gif" onLoad="F_loadRollover(this,'Contact_NRp2.gif',0)" BORDER=0 ALT="Contact Us"></A></TD>
</TR>
<TR VALIGN=TOP ALIGN=LEFT>
<TD WIDTH=195 HEIGHT=30><A HREF="./html/Grading_Standards.asp" onMouseOver="F_roll('NavigationButton7',1)" onMouseOut="F_roll('NavigationButton7',0)"><IMG ID="NavigationButton7" NAME="NavigationButton7" HEIGHT=25 WIDTH=170 SRC="./assets/images/autogen/Grading_Np1b.gif" onLoad="F_loadRollover(this,'Grading_NRp2.gif',0)" BORDER=0 ALT="Comic Grading Standards"></A></TD>
</TR>
<TR VALIGN=TOP ALIGN=LEFT>
<TD WIDTH=195 HEIGHT=30><A HREF="./html/Postage_and_Terms.html" onMouseOver="F_roll('NavigationButton8',1)" onMouseOut="F_roll('NavigationButton8',0)"><IMG ID="NavigationButton8" NAME="NavigationButton8" HEIGHT=25 WIDTH=170 SRC="./assets/images/autogen/Postage_Np1b.gif" onLoad="F_loadRollover(this,'Postage_NRp2.gif',0)" BORDER=0 ALT="Postage and Terms"></A></TD>
</TR>
<TR VALIGN=TOP ALIGN=LEFT>
<TD WIDTH=195 HEIGHT=30><A HREF="./html/Links.asp" onMouseOver="F_roll('NavigationButton9',1)" onMouseOut="F_roll('NavigationButton9',0)"><IMG ID="NavigationButton9" NAME="NavigationButton9" HEIGHT=25 WIDTH=170 SRC="./assets/images/autogen/Links_Np1b.gif" onLoad="F_loadRollover(this,'Links_NRp2.gif',0)" BORDER=0 ALT="Links"></A></TD>
</TR>

Kor
03-14-2006, 03:15 PM
Why onload event? Shouldn't be the onmouseover ? And shouldn't be an onmouseout event somewhere as well? And, what about building a single function to do that dynamically, not to write the whole sausage on and on for all the objects?

What in fact you want to do?

mazer
03-14-2006, 03:22 PM
Its just a mouseover effect on the buttons that I want to create, I got the page designed for me so I'm totally new to all this, I know there's a simpler way to do this but I'm not sure how to go about it!

Kor
03-14-2006, 04:07 PM
as far as I see, you have also a rollover function when rolling over the <a> tag, so that the otherwise looks aufully redundant.

What about this rollover for you?:

<script type="text/javascript">
function roll(p){
p.src=p.src.replace('Np1b','Np2b');
p.onmouseout=function(){
this.src=this.src.replace('Np2b','Np1b')
}
}
</script>
....
....
<td width="195" height="30"><a href="./html/mcfarlane_figures.asp"><img height="25" width="170" src="./assets/images/autogen/McFarlane_Figures_Np1b.gif" onmouseover="roll(this)" border="0" alt="McFarlane Figures"></a></td>
...
... and so on

DW & Flash user
12-09-2006, 09:41 PM
I have DreamWeaver 8 open right now. I am getting the same errors on all my pages. This is not one of my personal websites, rather one I had to create as my Assessment for a DreamWeaver course at my local Institiute of Further and Higher Education or put another way, Technical College. It has to be handed in on Monday.

Here is the first error:

The tag: "img" doesn't have an attribute: "onload" in currently active versions.[XHTML 1.0 transitional]

Here's the code:

<!-- #BeginLibraryItem "/Library/Navigation Bar.lbi" -->
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><a href="index.html" target="_top" onclick="MM_nbGroup('down','group1','Home','',1)" onmouseover="MM_nbGroup('over','Home','','',1)" onmouseout="MM_nbGroup('out')"><img src="Images/Home Image.jpg" alt="Home" name="Home" width="122" height="34" border="0" id="Home" onload="Home Image" /></a></td>
<td><a href="gallery.html" target="_top" onclick="MM_nbGroup('down','group1','Gallery','',1)" onmouseover="MM_nbGroup('over','Gallery','','',1)" onmouseout="MM_nbGroup('out')"><img src="Images/Gallery Image.jpg" alt="Gallery" name="Gallery" width="122" height="34" border="0" id="Gallery" onload="Gallery Image" /></a></td>
<td><a href="Order_form.html" target="_top" onclick="MM_nbGroup('down','group1','Order','',1)" onmouseover="MM_nbGroup('over','Order','','',1)" onmouseout="MM_nbGroup('out')"><img src="Images/Order Form Image.jpg" alt="Order Form" name="Order" width="122" height="34" border="0" id="Order" onload="Order Form Image" /></a></td>
<td><a href="about.html" target="_top" onclick="MM_nbGroup('down','group1','About','',1)" onmouseover="MM_nbGroup('over','About','','',1)" onmouseout="MM_nbGroup('out')"><img src="Images/About Image.jpg" alt="About" name="About" width="122" height="34" border="0" id="About" onload="About Image" /></a></td>
<td><a href="credits.html" target="_top" onclick="MM_nbGroup('down','group1','Credits','',1)" onmouseover="MM_nbGroup('over','Credits','','',1)" onmouseout="MM_nbGroup('out')"><img src="Images/Credits Image.jpg" alt="Credits" name="Credits" width="122" height="34" border="0" id="Credits" onload="Credits Image" /></a></td>
</tr>
</table>
<!-- #EndLibraryItem -->

My Navigation bar for this website works perfectly, so I shouldn't be getting any errors. I am not new to HTML.

After reading this thread I checked, I have mostly onMouseover behaviours and a couple of OnClick behaviours. This error appears in every page of the site.

The second error has been ongoing since 2003, according to my Google search, maybe even earlier. Here it is:

The tag name: "embed" Not found in currently active versions.[XHTML 1.0 transitional]

Here's the code:

<embed src="Thank You.swf" width="638" height="35" autostart="false" lang="en" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" bgcolor="#FFFFFF"></embed>
</object>

This is my second course at the same college, the first one was Flash. I have Flash text working fine on http://www.myweb.tiscali.co.uk/mmoyne/

This error only appears on my index.html page as that is the only page that contains Flash text.

Please help, and oh, here's a quick message for Adobe: Sort it out! You shouldn't have bought MacroMedia if you couldn't fix any problems with your own software.

I am however new to CSS, I have CSS issues. I got the code off CSS Zen Garden so I don't know about posting it.