On Mon, 21 Jan 2008 23:08:27 +0000, The Natural Philosopher wrote:
Quote:
I am a javascript novice, but surely you need to tell the function
toggleDetail that det is GLOBAL in scope? |
You really should read the specs on Javascript. All variables not
declared in a function become global. (*)
(*) To be more precise, they become elements on the super "global"
object that in web browser UAs "window" points to.
Quote:
There's probably a way to do that in Java shit too. |
Javascript is NOT C, or PHP nor any other language. Do not deride
it for being something it is not.
Every language has little quirks that make you want to pull your
hair out. No language is perfect and there are none that I"ve coded
in that I haven't sworn at.
Quote:
* Why does it work even more poorly in IE? The line with
getElementById() in particular seems not to rewrite the HTML.
I THINK I met this befre, SPANS can't have ID's - only DIVS can or
something. Or is it that they cant have inerHTML. |
Now you are not even talking about Javascript. You are referring to
the DOM, something which Javascript can access. They are tightly coupled
in most UAs, but not the same thing.
SPANS can have ID's.
InnerHTML has many known issues and is not part of the standard DOM
(yet). Unless one knows its limitations, it is best not to use it.
Quote:
Now you know why I call it Javashit. Its never the same syntax twice.. |
There are a large number of people who have done very well coding in
Javascript, and do not have to re-invent the wheel each time. Don't FIGHT
the language. Use it as should be used.
Personal note:
The first three or four languages I learned really cheesed me off, because
each one was so different from the other. Each paradyne shift has taught
me something taught me new and creative ways to curse.