| Welcome to Webforumz.com. |
|
Mar 24th, 2008, 00:08
|
#1 (permalink)
|
|
Junior Member
Join Date: Nov 2005
Posts: 20
|
[SOLVED] Validate Problems With onload
Hi,
I've just made the change from using GoLive and HTML to Dreamweaver CS3 and XHMTL and feeling a little in over my head.
I went to validate and came up with a series of errors related to the navigation buttons with the error: there is no attribute "onload"
The page can be seen at www.brainiacproductions.com/equal.html and the code looks like this:
- Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Brainiac Productions</title>
<link href="equalcolumns.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
if (event == "init" && args.length > 2) {
if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
nbArr[nbArr.length] = img;
for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = args[i+1];
nbArr[nbArr.length] = img;
} }
} else if (event == "over") {
document.MM_nbOver = nbArr = new Array();
for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
nbArr[nbArr.length] = img;
}
} else if (event == "out" ) {
for (i=0; i < document.MM_nbOver.length; i++) {
img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
} else if (event == "down") {
nbArr = document[grpName];
if (nbArr)
for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
document[grpName] = nbArr = new Array();
for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
nbArr[nbArr.length] = img;
} }
}
//-->
</script>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>
<body onload="MM_preloadImages('images/buttons/packages_over.gif','images/buttons/archiving_over.gif','images/buttons/demos_over.gif','images/buttons/gallery_over.gif','images/buttons/ideas_over.gif','images/buttons/faq_over.gif','images/buttons/how_over.gif','images/buttons/calculator_over.gif','images/buttons/order_over.gif','images/buttons/contact_over.gif','images/buttons/about_over.gif','images/buttons/home.gif')">
<div class="main-box">
<div class="top-box">
<br/>
<br/>
<br/>
</div>
<div class="center-box">
<div class="reset-box">
<div class="right-box">
<div class="content-box clearfix">
<div class="left">
<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','images/buttons/home.gif','',1)" onmouseout="MM_nbGroup('out')"><img src="images/buttons/home_over.gif" alt="Home Page" name="home" border="0" id="home" onload="" /></a></td>
</tr>
<tr>
<td><a href="packages.html" target="_top" onclick="MM_nbGroup('down','group1','packages','',1)" onmouseover="MM_nbGroup('over','packages','images/buttons/packages_over.gif','',1)" onmouseout="MM_nbGroup('out')"><img src="images/buttons/packages.gif" alt="Movie Package Details" name="packages" width="115" height="40" border="0" id="packages" onload="" /></a></td>
</tr>
<tr>
<td><a href="archiving.html" target="_top" onclick="MM_nbGroup('down','group1','archiving','',1)" onmouseover="MM_nbGroup('over','archiving','images/buttons/archiving_over.gif','',1)" onmouseout="MM_nbGroup('out')"><img src="images/buttons/archiving.gif" alt="Photo Archiving Services" name="archiving" width="115" height="40" border="0" id="archiving" onload="" /></a></td>
</tr>
<tr>
<td><a href="demos.html" target="_top" onclick="MM_nbGroup('down','group1','demos','',1)" onmouseover="MM_nbGroup('over','demos','images/buttons/demos_over.gif','',1)" onmouseout="MM_nbGroup('out')"><img src="images/buttons/demos.gif" alt="Demo Movies" name="demos" width="115" height="40" border="0" id="demos" onload="" /></a></td>
</tr>
<tr>
<td><a href="http://www.brainiacproductions.com/Gallery" target="_top" onclick="MM_nbGroup('down','group1','gallery','',1)" onmouseover="MM_nbGroup('over','gallery','images/buttons/gallery_over.gif','',1)" onmouseout="MM_nbGroup('out')"><img src="images/buttons/gallery.gif" alt="Gallery of Backgrounds" name="gallery" width="115" height="40" border="0" id="gallery" onload="" /></a></td>
</tr>
<tr>
<td><a href="ideas.html" target="_top" onclick="MM_nbGroup('down','group1','ideas','',1)" onmouseover="MM_nbGroup('over','ideas','images/buttons/ideas_over.gif','',1)" onmouseout="MM_nbGroup('out')"><img src="images/buttons/ideas.gif" alt="Creative Ideas" name="ideas" width="115" height="40" border="0" id="ideas" onload="" /></a></td>
</tr>
<tr>
<td><a href="http://www.brainiacproductions.com/FAQ" target="_top" onclick="MM_nbGroup('down','group1','faq','',1)" onmouseover="MM_nbGroup('over','faq','images/buttons/faq_over.gif','',1)" onmouseout="MM_nbGroup('out')"><img src="images/buttons/faq.gif" alt="Frequently Asked Questions" name="faq" width="115" height="40" border="0" id="faq" onload="" /></a></td>
</tr>
<tr>
<td><a href="how.html" target="_top" onclick="MM_nbGroup('down','group1','how','',1)" onmouseover="MM_nbGroup('over','how','images/buttons/how_over.gif','',1)" onmouseout="MM_nbGroup('out')"><img src="images/buttons/how.gif" alt="How To Guide" name="how" width="115" height="40" border="0" id="how" onload="" /></a></td>
</tr>
<tr>
<td><a href="calculator.html" target="_top" onclick="MM_nbGroup('down','group1','calculator','',1)" onmouseover="MM_nbGroup('over','calculator','images/buttons/calculator_over.gif','',1)" onmouseout="MM_nbGroup('out')"><img src="images/buttons/calculator.gif" alt="Package Price Calculator" name="calculator" width="115" height="40" border="0" id="calculator" onload="" /></a></td>
</tr>
<tr>
<td><a href="order.html" target="_top" onclick="MM_nbGroup('down','group1','order','',1)" onmouseover="MM_nbGroup('over','order','images/buttons/order_over.gif','',1)" onmouseout="MM_nbGroup('out')"><img src="images/buttons/order.gif" alt="Order Forms" name="order" width="115" height="40" border="0" id="order" onload="" /></a></td>
</tr>
<tr>
<td><a href="contact.html" target="_top" onclick="MM_nbGroup('down','group1','contact','',1)" onmouseover="MM_nbGroup('over','contact','images/buttons/contact_over.gif','',1)" onmouseout="MM_nbGroup('out')"><img src="images/buttons/contact.gif" alt="Contact Us" name="contact" width="115" height="40" border="0" id="contact" onload="" /></a></td>
</tr>
<tr>
<td><a href="about.html" target="_top" onclick="MM_nbGroup('down','group1','about','',1)" onmouseover="MM_nbGroup('over','about','images/buttons/about_over.gif','',1)" onmouseout="MM_nbGroup('out')"><img src="images/buttons/about.gif" alt="About Us" name="about" width="115" height="40" border="0" id="about" onload="" /></a></td>
</tr>
</table>
I've looked up some articles on XHTML but don't really understand what I am supposed to replace the onload with.
__________________
Geeky Girl
|
|
|
Mar 24th, 2008, 12:56
|
#2 (permalink)
|
|
Chief Moderator
Join Date: Oct 2007
Location: UK
Posts: 701
|
Re: Validate Problems With onload
You are allowed the attribute onload in XHTML markup, but you can only assign it to the body tag.
I just ran your site through the HTML validator, and the problem is occuring because there is an empty onload attribute on an <a> tag!
Get rid of this and things should be sorted.
__________________
|
|
|
Mar 24th, 2008, 21:24
|
#3 (permalink)
|
|
Junior Member
Join Date: Nov 2005
Posts: 20
|
Re: Validate Problems With onload
Thank you! That is why I kept only seeing the onload in reference to the body tag which wasn't helping me. I wasn't finding anything directly about using onload with images so now it makes sense.
I am a bit confused why Dreamweaver automatically uses code that doesn't exist in XHMTL when you set up the page with that document property. To me, it makes it harder to figure out the problems. (Just my two cents worth).
__________________
Geeky Girl
|
|
|
Mar 25th, 2008, 10:46
|
#4 (permalink)
|
|
Chief Moderator
Join Date: Oct 2007
Location: UK
Posts: 701
|
Re: Validate Problems With onload
Out of interest, are you using design view? Because that is notorious for messy code 
__________________
|
|
|
| Thread Tools |
|
|
| Rate This Thread |
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|