Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!


Sponsored Content

 

 
 

Photo
- - - - -

W3c Validated But Still An Error?


  • Please log in to reply
18 replies to this topic

#1 magicboxgifts

magicboxgifts

    HR 4

  • Active Members
  • PipPipPipPip
  • 117 posts
  • Location:Leicester UK

Posted 20 December 2004 - 03:10 PM

many hours getting my index page up to spec for W3C validator and FINALLY I passed (apparently this will help my SEO)

However, when I now visit the page the yellow error triangle shows up?

Any ideas out there. I have a feeling it could be my CSS, any tips on how to correct this?

Pllllllllllllllleaaaaaaaaaase help
Thanks

#2 Googlewhacked

Googlewhacked

    Got geek?

  • Active Members
  • PipPipPipPipPip
  • 348 posts
  • Location:Florida: The Plywood State

Posted 20 December 2004 - 03:17 PM

magicboxgifts,

I just ran you home page (www.magicboxgifts.com/index.php) through the official W3C HTML validator & it was fine. I also clicked on the validation graphic @ the bottom of your home page & it was also just fine.

Can you give me a hint as to which page (pref. a file name) is having the problem or what exact error the validator is returning?

Phil

#3 chrishirst

chrishirst

    A not so moderate moderator.

  • Moderator
  • 5,879 posts
  • Location:Blackpool UK

Posted 20 December 2004 - 03:25 PM

yellow triangle is a javascript error and it is caused by a chunk of style code in the middle of the script

CODE
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;
}
***************************************
no ending </script> here
*****************************************
<style type="text/css">
body,td,th {
    font-family: Arial, Helvetica, sans-serif;
}
body {
    background-color: #99CCFF;
}
.style4 {font-size: xx-small}
a:link {
    color: #003366;
}
a:visited {
    color: #666666;
}
a:hover {
    color: #000033;
}
a:active {
    color: #003399;
}
.style20 {font-size: 12px}
.style11 {font-size: 14px}
.style31 {font-size: x-small}
.style23 {font-size: 14px;
    color: #FF802B;
    font-weight: bold;
}
.style28 {font-size: 16px; font-weight: bold; color: #003366; }
.style51 {color: #FF802B}
.style66 {color: #003366}
.style73 {
    font-size: 14px;
    color: #003366;
    font-weight: bold;
}
.style75 {font-size: 10px; font-weight: bold; }
.style80 {font-size: x-small; color: #000000; }
.style81 {font-size: 12px; color: #003366; font-weight: bold; }
.style72 {font-size: 14px; font-weight: bold; }
-->
<!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
****************************************
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
 if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
   document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
 else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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;
 } }
}

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_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];}
}
//-->
</script>
<style type="text/css">

Edited by chrishirst, 20 December 2004 - 03:31 PM.


#4 Googlewhacked

Googlewhacked

    Got geek?

  • Active Members
  • PipPipPipPipPip
  • 348 posts
  • Location:Florida: The Plywood State

Posted 20 December 2004 - 03:33 PM

Aaaaaah! No wonder I couldn't find the problem! Firefox doesn't use the yellow triangle for JS errors... DOH! eek.gif

#5 magicboxgifts

magicboxgifts

    HR 4

  • Active Members
  • PipPipPipPip
  • 117 posts
  • Location:Leicester UK

Posted 21 December 2004 - 02:57 AM

most gracious thanks chaps

Now to work on climbing the SE :learn:

#6 magicboxgifts

magicboxgifts

    HR 4

  • Active Members
  • PipPipPipPip
  • 117 posts
  • Location:Leicester UK

Posted 21 December 2004 - 05:45 AM

Guys, now I am completely bamboozeled

Added the /SCRIPT where indicated, page not validated showing as FAILED
Remove the /script and it validates but shows an IE error triangle

Is this just an IE anomaly or do I need to change something


aggghhhh
Thanks

#7 chrishirst

chrishirst

    A not so moderate moderator.

  • Moderator
  • 5,879 posts
  • Location:Blackpool UK

Posted 21 December 2004 - 06:15 AM

If you look at the code carefully you'll see what has happened. DW has put a chunk of style sheet code into the javascript (or duplicated the javascript).

I put another row of asterisks where the end of the style code is in the post above


good example how DW can also censored.gif about with your code when you take your eye off it for a second hmm.gif

#8 magicboxgifts

magicboxgifts

    HR 4

  • Active Members
  • PipPipPipPip
  • 117 posts
  • Location:Leicester UK

Posted 21 December 2004 - 06:39 AM

CHEERS CHRIS cheers.gif

I use to ignore those in the code, but not anymore

Thanks again

#9 magicboxgifts

magicboxgifts

    HR 4

  • Active Members
  • PipPipPipPip
  • 117 posts
  • Location:Leicester UK

Posted 21 December 2004 - 12:06 PM

Last call (I hope)

All appeared well until I checked back around 30 mins ago.

Error triangle BACK AGAIN this time saying

LINE 160
CHAR 1
ERROR :EXPECTED OBJECT
CODE 0
URL: www.mydomain.com

AND the nav bar has stopped rolling over.....all since we made code changes to become W3C complaint. Whats gone pete tong?! I cant spot anything out of place...

#10 chrishirst

chrishirst

    A not so moderate moderator.

  • Moderator
  • 5,879 posts
  • Location:Blackpool UK

Posted 21 December 2004 - 02:24 PM

your menu function MM_nbGroup(event, grpName) has only 2 parameters but is getting called with 5

onmouseover="MM_nbGroup('over','home','IMAGES/buttons/home_on.gif','',1)


censored.gif javascript rollovers ranting.gif

BTW can you tell that I dislike javascript immensely and rarely, if ever use it on any site.

CSS rollovers work just as well with none of the hassle. IMO and are spider friendly.

#11 magicboxgifts

magicboxgifts

    HR 4

  • Active Members
  • PipPipPipPip
  • 117 posts
  • Location:Leicester UK

Posted 22 December 2004 - 04:12 AM

Just been doing some research on CSS rollovers et al and I think I will be changing them over.

Not overly comfortable with java anyway, too easy to go wrong!

Thanks Chris

#12 linux_lover

linux_lover

    LiLo

  • Active Members
  • PipPipPipPipPipPip
  • 831 posts
  • Location:York, UK

Posted 22 December 2004 - 04:22 AM

If you think you need to use Java to do rollovers I would stick with CSS unsure.gif

I hate Javascript too for the record - sometimes I have to use it tho sad.gif I wouldnt like to rely on it for form checking etc - what if user has it turned off? Not good...

#13 chrishirst

chrishirst

    A not so moderate moderator.

  • Moderator
  • 5,879 posts
  • Location:Blackpool UK

Posted 22 December 2004 - 05:51 AM

I won't use javascript for even form validation. It's seems much simpler to validate server-side and build an array of errors then have my form display routine fill in all valid information and show a error message above or along side the appropriate input.
Far more user friendly than alert boxes that once you have clicked ok you then realise you don't know what the error was anyway because the box said "please fill in all required fields" unsure.gif

#14 magicboxgifts

magicboxgifts

    HR 4

  • Active Members
  • PipPipPipPip
  • 117 posts
  • Location:Leicester UK

Posted 22 December 2004 - 06:10 AM

excellent call Chris, removing the java for the validation would IMO certainly add to the usability as stated

I have ripped out all bar the validation java (nearly time to ale.gif so I will complete after chimbo) sorted out my present css and got that validated too so all is well for now on index (apart from the layout, still not happy YET or am I looking too deep into it??)

Once I have sorted out the css for the nav bar and validation I shall implement site wide.

Server side validation sounds excellent, any good reference sites that you have used (apart from here of course )for me to bone up on

#15 chrishirst

chrishirst

    A not so moderate moderator.

  • Moderator
  • 5,879 posts
  • Location:Blackpool UK

Posted 22 December 2004 - 06:50 AM

the resource sites I use mainly are W3 Schools & DevGuru If you need something very techie take a look at Tek Tips. specialised forums on just about any subject, just about every question ever will have been asked and answered at some time. PHP Main site though trying to find some thing in particular is almost as bad as trying to recall the function names in PHP lol.gif

plus a few others here and there. I'll make a list one day and post it on the cobblers kids website.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users