X
X l e c t r i c
webtv versions prior to 2.9 do not recognize document.getElementById, so
we have to use a conditional that includes document.all.
I've been trying to use a variable for document.all and
document.getElementById to simplify my functions. It works for the
latest versions of Explorer, Opera, and webtv. It does not work for the
latest versions of Firefox, Netscape, and SeaMonkey.
Here are two examples of what I'm trying to do. It's the "DOM "with" a
variable" versions that don't work with all the browsers.
Using divisions:
http://www.xlectric.com/info/js/domvartest.html
Using forms:
http://www.xlectric.com/info/js/domvartestfm.html
I realize that with the forms versions I can use the forms array, like I
do in the third example. It works and it's valid. It's with the
divisions versions that something like this would really simplify my
functions. I even tried making a separate function that I could use as a
method within the oC() function, but I was never able to sort that out
either.
Also, the results were the same when using the HTML 4.01 strict dtd.
If it is possible to make something like this work for all the browsers,
then I would appreciate it if it could be pointed out what I'm doing
wrong.
Art
we have to use a conditional that includes document.all.
I've been trying to use a variable for document.all and
document.getElementById to simplify my functions. It works for the
latest versions of Explorer, Opera, and webtv. It does not work for the
latest versions of Firefox, Netscape, and SeaMonkey.
Here are two examples of what I'm trying to do. It's the "DOM "with" a
variable" versions that don't work with all the browsers.
Using divisions:
http://www.xlectric.com/info/js/domvartest.html
Using forms:
http://www.xlectric.com/info/js/domvartestfm.html
I realize that with the forms versions I can use the forms array, like I
do in the third example. It works and it's valid. It's with the
divisions versions that something like this would really simplify my
functions. I even tried making a separate function that I could use as a
method within the oC() function, but I was never able to sort that out
either.
Also, the results were the same when using the HTML 4.01 strict dtd.
If it is possible to make something like this work for all the browsers,
then I would appreciate it if it could be pointed out what I'm doing
wrong.
Art