Re: Of mice and men



Pete Dashwood wrote:
Thanks for the information, Arnold.

As far as I know there are no ActiveX controls involved. (COM is something
I'm pretty fluent in...).

My Firefox (under Linux) wanted a plug-in to play the wav file. (Odd, but it should still work without it.)


I have revised the code today, but I can't spend too much time on it and I
can't test it with Netscape.

You could install the latest Firefox for Windows - just be sure to make it *not* your default for anything, and it should leave your web shortcuts opening in IE the way they do today. :)


What I HAVE learned today is that Netscape is MUCH more limiting in it's use
of Javascript than IE is.

It is ironic that although Netscape invented it, the MS implementation is
much richer.

Richard has already hit on some of this, but I decided to look at the code, when the timer didn't work after I started typing. (By the way - XHTML? I'm impressed! :> ) Let me also preface this by saying I realize you've probably spent more time on it than you wanted to to begin with, so if you don't change this particular page, it's no skin off my back.


You're using shortcuts that Microsoft lets you get away with, but other browsers do not. (Why that is, I don't know.) For example, on line 176 (at least that's the line in my browser) you reference "tabmonths". This is where JavaScript gets more verbose than COBOL! ;) For it to be "portable", you have to qualify everything up to the document element. (You can define variables to use as shortcuts as well.)

So, instead of just saying...

tabmonths.disabled = true;

,you can say...

document.getElementById("tabmonths").disabled = true;

....or, if you're going to reference it a lot...

var tabM = document.getElementById("tabmonths");
tabM.disabled = true;

(You can put the "var" statement outside all of your functions, and it'll be globally scoped, so any functions can access it. We use that at work to select the documents in different parts of the frameset.)

I'll bet, if you qualified all your form references with something like the above, it would work for everyone. There is also a "forms" collection, which you can use to reference your various input elements - these are accessed either like this...

// This blanks the value of this input element
document.forms[0].nameOfMyInputElement.value = "";

.... (where [0] is the index on the page), or like this...

// This does the same thing!
document.forms["myFormName"].nameOfMyInputElement.value = "";

This is some stuff that I've just recently come across, and it is really nice, especially that getElementById method. Gone is the feud between document.all and document.layers - just name it and change it! :)

The most shocking to me was that Netscape doesn't support event handling
('onClick', which is fundamental) for a <TD> tag.

Not quite sure, but I think the capital "C" may be throwing you off (especially using XHTML).



-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ / \ / ~ Live from Montgomery, AL! ~ ~ / \/ o ~ ~ ~ / /\ - | ~ daniel@thebelowdomain ~ ~ _____ / \ | ~ http://www.djs-consulting.com ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ GEEKCODE 3.12 GCS/IT d s-:+ a C++ L++ E--- W++ N++ o? K- w$ ~ ~ !O M-- V PS+ PE++ Y? !PGP t+ 5? X+ R* tv b+ DI++ D+ G- e ~ ~ h---- r+++ z++++ ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .



Relevant Pages

  • Re: Javascript Best Practices Document v1.0
    ... If Typeis not Reference, ... > "some browsers" should be sctrictly avoided in the discussion. ... I *know* that it will fail in some environments just because environments ... That depends on what DOM we are talking about. ...
    (comp.lang.javascript)
  • Re: Passing variable values between code modules.
    ... When you reference the "public" variable that is another form's module, ... must qualify it by including the reference to the module in which it's ... intNewContestID = intNewContestID + 1 ... MsgBox ("You can not move this team deffnition to the " & ...
    (microsoft.public.access.formscoding)
  • Re: what is the difference?
    ... 'this' passes a reference to the A element as ... to the HTML element's event object in Gecko-based (and probably all W3C ... targ = e.srcElement; ... in all browsers and also downward in W3C conforming browsers). ...
    (comp.lang.javascript)
  • Re: Clear all optgroups and options from a select list
    ... Your response was essentially to give every option ... It did not require an ID, it required either an id or a reference, ... Also the windowing system itself works, ... specs are what browsers should implement, ...
    (comp.lang.javascript)
  • Re: Microsoft Access Expression Problem
    ... Since you have two tables with a field named Date then you need to qualify the reference to the Date field by adding the table name ... John Spencer ... "Syntax error (missing operator) in query ...
    (microsoft.public.access.queries)