Firefox javascript problem!!

A

Aquila Deus

Why doesn't SomeElementID.propertyOrMethod work anymore?? It still
works in IE but firefox says "SomeElementID is not defined" (it used to
throw a warning but still works) How can I enable it??
 
S

SpaceGirl

Aquila said:
Why doesn't SomeElementID.propertyOrMethod work anymore?? It still
works in IE but firefox says "SomeElementID is not defined" (it used to
throw a warning but still works) How can I enable it??

Must be a problem elsewhere in your code - as usual with these things,
no url, no help... :)

--


x theSpaceGirl (miranda)

# lead designer @ http://www.dhnewmedia.com #
# remove NO SPAM to email, or use form on website #
 
A

Aquila Deus

SpaceGirl said:
Must be a problem elsewhere in your code - as usual with these things,
no url, no help... :)

I found the problem: It's a <inpput> inside a <form>, so that if I use
FormID.SomeInputID, it would work. But not if I use SomeInputID.
 
D

DU

Aquila said:
used to



I found the problem: It's a <inpput> inside a <form>, so that if I use
FormID.SomeInputID, it would work. But not if I use SomeInputID.

At this url

Using Web Standards in Your Web Pages
http://www.mozilla.org/docs/web-developer/upgrade_2.html

you'll find IE-specific ways to access elements and their correspondent
W3C web standards replacements to make your page
- web-standards compliant (W3C DOM compliant)
- working in MSIE 5+
- working in Firefox, Mozilla, Netscpae 6+, Opera 7+, Konqueror 3.x,
Safari 1.x, etc.

id_attribute_value should be replaced with
document.getElementById(id_attribute_value).

DU
 
A

Aquila Deus

DU said:
At this url

Using Web Standards in Your Web Pages
http://www.mozilla.org/docs/web-developer/upgrade_2.html

you'll find IE-specific ways to access elements and their correspondent
W3C web standards replacements to make your page
- web-standards compliant (W3C DOM compliant)
- working in MSIE 5+
- working in Firefox, Mozilla, Netscpae 6+, Opera 7+, Konqueror 3.x,
Safari 1.x, etc.

id_attribute_value should be replaced with
document.getElementById(id_attribute_value).

I don't see any reason to use the terribly long method instead of just
"MyID".
 
A

Aquila Deus

DU said:
At this url

Using Web Standards in Your Web Pages
http://www.mozilla.org/docs/web-developer/upgrade_2.html

you'll find IE-specific ways to access elements and their correspondent
W3C web standards replacements to make your page
- web-standards compliant (W3C DOM compliant)
- working in MSIE 5+
- working in Firefox, Mozilla, Netscpae 6+, Opera 7+, Konqueror 3.x,
Safari 1.x, etc.

id_attribute_value should be replaced with
document.getElementById(id_attribute_value).

I don't see any reason to use the terribly long method instead of just
"MyID".
 
L

Leif K-Brooks

Aquila said:
I don't see any reason to use the terribly long method instead of just
"MyID".

Because using nothing but "someID" is a made up method that will only
work in browsers which are hopelessly broken.
 
L

Leif K-Brooks

Aquila said:
hmmmm, since all browsers are hopelessly broken, why should I care then?

Because browsers are likely to get half a clue within the next century
or so. Why rely on broken behavior when the proper solution is cleaner
and guaranteed to work now and in the future?
 
A

Aquila Deus

Leif said:
then?

Because browsers are likely to get half a clue within the next century
or so. Why rely on broken behavior when the proper solution is cleaner
and guaranteed to work now and in the future?

Ah, what if M$ assimilates W3C someday? And why doesn't W3C just accept
MyElementID? It makes my web dev much easier! (don't they know DOM is
really a crap thing at all??)
 
T

Toby Inkster

Aquila said:
I don't see any reason to use the terribly long method instead of just
"MyID".

<body>
<p id="document">Blah.</p>
<script type="text/javascript">
function clickHandler() {
window.alert("Hello");
}
document.onClick = clickHandler;
</script>
</body>

In the Javascript, does "document" refer to the paragraph with ID
"document", or does it refer to the whole document?

document.getElementByID("document") is unambiguous.
 
A

Aquila Deus

Toby said:
<body>
<p id="document">Blah.</p>
<script type="text/javascript">
function clickHandler() {
window.alert("Hello");
}
document.onClick = clickHandler;
</script>
</body>

In the Javascript, does "document" refer to the paragraph with ID
"document", or does it refer to the whole document?

document.getElementByID("document") is unambiguous.

I see. But it's not my problem, never. Because I always Capitalized
IDs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top