Jump to content

problems with javascript in validation


swissbeets

Recommended Posts

I am a very new to designing webpages and just recently got my site up and running. i am now at the point i want to validate my page, (only because i have read that it is important to have ur page validated)  but i came up with so many errors i may never get through it.  I am getting a lot of errors in the Javascript functions that preload the images for my navigation bar,  i know these are fine because i copied them directly from dreamweaver?

 

anyone else ever had this problem? 

Link to comment
Share on other sites

first of all...Dreamweavers mouseovers for navigation are horrible. it can be done easier and faster WITHOUT javascript/preloading images, but takes a little bit of image editing.

 

Step 1) Take the 2 images you have (one for the normal and one for the rollover) and make them one image, that is twice as tall. Put the normal image on top and the rollover below it.

 

Step 2) Make your nav items empty <a> tags, with the href portion filled in of course.

 

Step 3) Set the background-image style property on each A tag to the respective image from step 1

 

Step 3) In your Stylesheet, put something similar to the following:

#navigation a {
  display: block;
  padding: 0;
  margin: 0;
  width: 270px; /* width of image */
  height: 34px; /* height of 1 image - aka half height of image from step 1 */
  background-repeat: no-repeat;
  background-position: 0 0;
}
#navigation a:hover {
  background-position: 0 -34px; /* negative version of height from above */
}

Link to comment
Share on other sites

yes, http://validator.w3.org/,    the site is www.bigpeckersstuff.com

 

it is my first one, so there is still alot that needs done.  i took all of the javascript out of the index to make sure that was the problem and it was but from any of the other pages you can see all the problems.   

 

Let me know if you see any glaring problems and please dont be too harsh....

 

Thank you

Link to comment
Share on other sites

i will change that immediately thank you,  i know very little javascript but figured since dreamweaver made it i might as well use it,    i believe i got it working a lot better.    please let me know of anything else you see it is greatly appreciated. i will attempt to get it validated today and then post my site to be critiqued

 

but even with the javascript in the head i am getting 70 errors with at least 50 from the javascript is this  alarge enough problem that i should take the way you posted earlier?

Link to comment
Share on other sites

eventhough i redid the navigation bar with dreamweaver and assigned only the up image, it is still using many of these javascript functions

 

here is my code

<td id="page"><a href="/index.php" target="_top" onclick="MM_nbGroup('down','group1','home','',1)" onmouseover="MM_nbGroup('over','home','','',1)" onmouseout="MM_nbGroup('out')"><img src="/images/home.gif" alt="" name="home" width="75" height="100" border="0" id="home" onload="" /></a><br />
	  <a href="/Products.php" target="_top" onclick="MM_nbGroup('down','group1','products','',1)" onmouseover="MM_nbGroup('over','products','','',1)" onmouseout="MM_nbGroup('out')"><img src="/images/products.gif" alt="" name="products" width="75" height="100" border="0" id="products" onload="" /></a><br />
	  <a href="/shoppingcart.php" target="_top" onclick="MM_nbGroup('down','group1','shoppingcart','',1)" onmouseover="MM_nbGroup('over','shoppingcart','','',1)" onmouseout="MM_nbGroup('out')"><img src="/images/shoppingcart.gif" alt="" name="shoppingcart" width="75" height="100" border="0" id="shoppingcart" onload="" /></a><br />
	  <a href="/contactus.php" target="_top" onclick="MM_nbGroup('down','group1','contactus','',0)" onmouseover="MM_nbGroup('over','contactus','','',0)" onmouseout="MM_nbGroup('out')"><img src="/images/contactus.gif" alt="" name="contactus" width="75" height="100" border="0" id="contactus" onload="" /></a><br />

 

it seems like it might be easier for me to just make it from scratch

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.