[SOLVED] Validate Problems With onload

This is a discussion on "[SOLVED] Validate Problems With onload" within the Web Page Design section. This forum, and the thread "[SOLVED] Validate Problems With onload are both part of the Design Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Mar 24th, 2008, 00:08
Junior Member
Join Date: Nov 2005
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
[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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Mar 24th, 2008, 12:56
Aso's Avatar
Aso Aso is online now
Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,325
Blog Entries: 2
Thanks: 10
Thanked 48 Times in 45 Posts
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.
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Mar 24th, 2008, 21:24
Junior Member
Join Date: Nov 2005
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
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).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Mar 25th, 2008, 10:46
Aso's Avatar
Aso Aso is online now
Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,325
Blog Entries: 2
Thanks: 10
Thanked 48 Times in 45 Posts
Re: Validate Problems With onload

Out of interest, are you using design view? Because that is notorious for messy code
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Validate name field Graisbeck PHP Forum 2 Jan 13th, 2008 15:26
[SOLVED] Please help validate 4 css errors! Oak Web Page Design 3 Jan 10th, 2008 11:20
[SOLVED] How to Validate a HTML Contact Form Xhmtl Web Page Design 2 Dec 9th, 2007 20:11
[SOLVED] Validate Form Class soloam JavaScript Forum 2 Nov 28th, 2007 14:51
[SOLVED] Page doesn't validate. mcdanielnc89 Web Page Design 9 Oct 23rd, 2007 05:19


All times are GMT. The time now is 11:07.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42