Click to See Complete Forum and Search --> : IE errors


bobmurphy
08-31-2003, 02:48 PM
would someone take a look at the javascript on my page and tell me is there something wrong with it - i have the html and css on the page validated but still there are IE errors -- i'm not much of a java programmer but this technique does what i want it to do ( except for the errors that is ) -- i really hope that my technique if it is buggy can be fixed or an alternative came up with

http://www.oneweekofdays.com/testerfolder/master/index.html

thanks a mil

bob

Charles
08-31-2003, 02:51 PM
Originally posted by bobmurphy
would someone take a look at the javascript on my page and tell me is there something wrong with itI would if I could but I can't so I won't. I dont know the URL.

AdamGundry
09-01-2003, 07:24 AM
The first thing I came across when checking your page is that you have used document.getelementbyid - because Javascript is case-sensitive, that should be document.getElementById. Valid HTML and CSS are good, but the errors you refer to are in Javascript, not either of them.

Adam

Fang
09-01-2003, 07:40 AM
bobmurphy it would help if you read your previous thread (http://forums.webdeveloper.com/showthread.php?s=&threadid=16425) :mad:

Charles
09-01-2003, 07:46 AM
A couple of notes.

1) You've got a number of instances where you've got the case wrong in the JavaScript.

2) Inside of "navlink1" you dont't need to write "document.getelementbyid('navlink1').innerHTML". "this.innerHTML" will do just fine - as will "this.innerText" in this case.

3) The W3C DOM method is, however, "this.firstChild.data".

4) You shouldn't be using classes as unique identifiers. The ids will do just fine.

5) Why not just use CSS?

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<link rel="stylesheet" href="/testerfolder/master/masterStyleSheet.css" type="text/css"/>
<link rel="stylesheet" href="stylesheet.css" type="text/css"/>
<title>one week of days</title>
</head>
<style type="text/css">

#menu a {display:block}
#menu a:link, #menu a:visited {text-transform:lowercase}
#menu a:hover, #menu a:active {text-transform:uppercase}

</style>
<body>
<div id="menu">
<a href="/board/">board</a>
<a href="/biog/">biog</a>
<a href="/news/">news</a>
<a href="/links/">links</a>
<a href="/live/">live</a>
<a href="/music/">music</a>
<a href="/photos/">photos</a>
<a href="/promo/">promo</a>
</div>
</body>
</html>

bobmurphy
09-01-2003, 04:59 PM
thanks for all your help - i have gotton all that sorted out -- it was the case sensitivity mainly --- sorry fang i didn't really understand your post (though in hindsight ...... :mad: ) ---- also i put in a lot of the code you suggested charles -- it works great --- ( i still think i need the classes aswell as the identifiers -- check out the page now to see why {link flips work differently } www.oneweekofdays.com/testerfolder/master )

anyway the page validates Xhtml aswell as css but is there any way that i can validate it from a javascript point of view ?? --- i'm really more of a plagurist than a programmer and i haven't got the foggiest what i'm doing -- only that it works -- so i'd like to know whether or not i'm getting it right in theory aswell as in pracitce ( also to futureproof it as much as possible; if possible !!! ) :D


Ps i have some other issues to do with acurately positioning the flips but i think i will start another thread in one of the other ( more appropriate ) forums :eek:

bobmurphy
09-02-2003, 08:26 AM
[QUOTEis there any way that i can validate it from a javascript point of view ?? [/QUOTE] :p

Fang
09-02-2003, 08:56 AM
You can validate your javascript code here (http://www.crockford.com/javascript/jslint.html), but it may seem a little cryptic if you're a beginner at javascript.

As for my previous comment, I did point out the importance of case (document.getElementById) in your previous thread only to see it repeated again here.