Jump to content

XHTML Validation - Image Maps


ev5unleash

Recommended Posts

I'm trying to use image maps on my page but it seems something I'm doing in W3C's is wrong. Please tell me what this error message means and how I could fix it. http://validator.w3.org/check?uri=http://ev5unleash.dnsalias.org:85/websites/biosite/layout.html;accept=text/xml,application/xml,application/xhtml%2Bxml,text/html;q%3D0.9,text/plain;q%3D0.8,image/png,*/*;q%3D0.5;accept-language=en-US,en;accept-charset=ISO-8859-1,*,utf-8

 

Thanks, Evan

 

<!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>Biology Educational Website</title>
<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_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('The following error(s) occurred:\n'+errors);
    document.MM_returnValue = (errors == '');
} }
//-->
</script>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body onload="MM_preloadImages('/websites/biologywebsite/images/links/homeovr.png','/websites/biologywebsite/images/links/lessonsovr.png','/websites/biologywebsite/images/links/quizovr.png','/websites/biologywebsite/images/links/aboutovr.png')">
<table align="center" class="homepage">
  <tr>
    <td width="150" rowspan="2" align="center" valign="top"> </td>
    <td height="15" colspan="2" align="right" valign="top"> </td>
  </tr>
  <tr>
    <td width="736" height="100" align="right" valign="top"><form id="login" name="login" method="post" action="login.php">
        <label><span class="textbox">Username

          </span>
          <input name="Username" type="text" class="textbox" id="Username" />
          <span class="textbox">Password</span>
          <input name="Password" type="password" class="textbox" id="Password" />
<input name="loginbutton" type="submit" class="textbox" id="loginbutton" onclick="MM_validateForm('Username','','R','Password','','R');return document.MM_returnValue" value="Login" />
        </label>
    </form></td>
    <td width="21" align="right" valign="top"> </td>
  </tr>
  <tr>
    <td width="150" height="28" align="center" valign="top"><a href="#"><img src="images/links/home.png" alt="Home" name="Image1" width="130" height="28" id="Image1" onmouseover="MM_swapImage('Image1','','/websites/biologywebsite/images/links/homeovr.png',1)" onmouseout="MM_swapImgRestore()" /></a></td>
    <td colspan="2" rowspan="6"> </td>
  </tr>
  <tr>
    <td height="25" align="center" valign="top"><a href="#"><img src="images/links/lessons.png" alt="Lessons" width="130" height="28" id="Image2" onmouseover="MM_swapImage('Image2','','/websites/biologywebsite/images/links/lessonsovr.png',1)" onmouseout="MM_swapImgRestore()" /></a></td>
  </tr>
  <tr>
    <td height="25" align="center" valign="top"><a href="#"><img src="images/links/quiz.png" alt="Quiz's" width="130" height="25" id="Image3" onmouseover="MM_swapImage('Image3','','/websites/biologywebsite/images/links/quizovr.png',1)" onmouseout="MM_swapImgRestore()" /></a></td>
  </tr>
  <tr>
    <td height="25" align="center" valign="top"><a href="#"><img src="images/links/about.png" alt="About" width="130" height="28" id="Image4" onmouseover="MM_swapImage('Image4','','/websites/biologywebsite/images/links/aboutovr.png',1)" onmouseout="MM_swapImgRestore()" /></a></td>
  </tr>
  <tr>
    <td height="653" align="center" valign="top"> </td>
  </tr>
  <tr>
    <td align="center" valign="top"><img src="/websites/biosite/images/w3c.png" width="120" height="105" border="0" usemap="#Map" /></td>
  </tr>
</table>

<map name="Map" id="Map">
  <area shape="rect" coords="8,4,105,52" href="http://www.w3c.com" alt="W3C.com" />
  <area shape="rect" coords="19,55,97,74" href="http://validator.w3.org/check?uri=referer" alt="XHTML Validation" />
  <area shape="rect" coords="36,77,79,98" href="http://jigsaw.w3.org/css-validator/check/referer" alt="CSS Validation" />
</map>
</body>
</html>

Link to comment
Share on other sites

Thank link times out, so we can't see what the error is.

 

I have one image map on my site and the only difference I saw is that my <map><area /></map> comes before my image in my HTML.  However, without actually knowing what error you're getting, I can't offer much more advice.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.