473,385 Members | 1,587 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

IE work. Firefox Does not...help

Hi,

I have some Javascript that works on IE 6-7 but not Firefox(FF).

FF throws this error when clicked:

Hello,

Using Publisher 6.2 and Firefox 2.0

We have a customized Publisher template that creates some Javascript
that work fine in IE 6-7, but not FF.

FF returns this error:

Element referenced by ID/NAME in the global scope. Use W3C standard
document.getElementById() instead.
[Break on this error] undefined
(line 1)
oNug.all is not a function
[Break on this error] var e = oNug.all("disp");

How do I make it W3C compliant? Syntax help please!

Would I say var e=oNug.getElementById("disp"); ?

Why does it work with IE and not FF?

Thanks,

Tmuld
Jun 27 '08 #1
6 1166
Tmuldoon schrieb am 24.04.2008 17:08:
I have some Javascript that works on IE 6-7 but not Firefox(FF).

FF throws this error when clicked:

Hello,

Using Publisher 6.2 and Firefox 2.0

We have a customized Publisher template that creates some Javascript
that work fine in IE 6-7, but not FF.
We need your code for detailed analysis.
FF returns this error:

Element referenced by ID/NAME in the global scope. Use W3C standard
document.getElementById() instead.
[Break on this error] undefined
(line 1)
oNug.all is not a function
[Break on this error] var e = oNug.all("disp");

How do I make it W3C compliant? Syntax help please!

Would I say var e=oNug.getElementById("disp"); ?
Try this:
var e=document.getElementById("disp");
Why does it work with IE and not FF?
document.all is a MS invention. After that, the W3C has designed the
proper DOM functions, which were implemented by FF and MS.

--
Mit freundlichen Grüßen
Holger Jeromin
Jun 27 '08 #2
Tmuldoon wrote:
Using Publisher 6.2
Your apparently unsuitable development environment hardly matters here.
and Firefox 2.0

We have a customized Publisher template that creates some Javascript
that work fine in IE 6-7, but not FF.

FF returns this error:

Element referenced by ID/NAME in the global scope. Use W3C standard
document.getElementById() instead.
[Break on this error] undefined
(line 1)
oNug.all is not a function
[Break on this error] var e = oNug.all("disp");

How do I make it W3C compliant? Syntax help please!

Would I say var e=oNug.getElementById("disp"); ?
The error message indicates that `oNug' either does not refer to an object
that implements the HTMLDocument interface[1] or that Fx's Gecko is
rendering in Standards Compliance Mode. Therefore:

var e = document.getElementById("disp");
if (e)
{
// ...
}

or

var e = oNug.getElementsByName("disp");
if (e && (e = e[0]))
{
// ...
}

or, if "disp" is the name or ID of a form control within a `form' element:

var e = document.forms[zeroBasedNumberOrName].elements["disp"];

(You need to use e[zeroBasedNumber] if there is more than one control with
that name in the specified form.)

[1] http://www.w3.org/TR/DOM-Level-2-HTML/html.html
Why does it work with IE and not FF?
Because the `all' property/method is an MSHTML-proprietary feature that is
only sparsely supported by Fx, and then in Quirks Mode only. Avoid this
feature.
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Jun 27 '08 #3
VK
On Apr 24, 7:08 pm, Tmuldoon <tmuld...@spliced.comwrote:
FF returns this error:

Element referenced by ID/NAME in the global scope. Use W3C standard
document.getElementById() instead.
Well, the error description seems very clear. Don't use
document.all("disp") and use document.getElementById("disp") instead.
What is exactly not clear here?

Jun 27 '08 #4
VK wrote:
On Apr 24, 7:08 pm, Tmuldoon <tmuld...@spliced.comwrote:
>FF returns this error:

Element referenced by ID/NAME in the global scope. Use W3C standard
document.getElementById() instead.

Well, the error description seems very clear. Don't use
document.all("disp") and use document.getElementById("disp") instead.
What is exactly not clear here?
Only that the OP is not using `document.all' at the moment which causes a
standards-compliant solution to depend on the context in which the
proprietary `all' property was used before.
PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
Jun 27 '08 #5
On 28 avr, 10:20, VK <schools_r...@yahoo.comwrote:
Element referenced by ID/NAME in the global scope. Use W3C standard
document.getElementById() instead.

Well, the error description seems very clear. Don't use
document.all("disp") and use document.getElementById("disp") instead.
What is exactly not clear here?
No... not really. The OP was most likely using

var e = disp;

when in fact he should have been using

var e = document.getElementById("disp");

In IE, one can get script access to an id-ed element by simply using
its
id attribute value.
It's a very frequent error. And there are still many MSDN articles,
MSDN
code examples using the ID attribute to access elements.

Using Web Standards
Accessing Elements with the W3C DOM
http://developer.mozilla.org/en/docs...th_the_W3C_DOM

Regards, Gérard
Jun 27 '08 #6
GTalbot wrote:
On 28 avr, 10:20, VK <schools_r...@yahoo.comwrote:
>>Element referenced by ID/NAME in the global scope. Use W3C standard
document.getElementById() instead.
Well, the error description seems very clear. Don't use
document.all("disp") and use document.getElementById("disp") instead.
What is exactly not clear here?

No... not really. The OP was most likely using

var e = disp;

when in fact he should have been using

var e = document.getElementById("disp");
You are mistaken. First, there is no need to speculate about the OP's code
as the offending code is already in the error message, and Firefox's
behavior is very clear here. Second, see
<news:48**************@PointedEars.de>.
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Jun 27 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Cliff R. | last post by:
Hi, I use a handy little Javascript Flash detection script on a number of sites (copied below). Usually works great, but I just started trying Firefox and it's not working. A few browsers are...
3
by: niconedz | last post by:
Hi The following code works fine in IE but not Firefox. It's a little script that zooms an image and resizes the window to fit. Can anybody tell me what's wrong? Thanks Nico == btw.....
1
by: sam | last post by:
Hi all, Hope some expert can help me resolve this. I am using the following code to resize an iframe according to the content in it so that the iframe does not use its scroll bar and uses the...
11
by: minnesotti | last post by:
Hi there, I subscribed to a photographic pictures-hosting website which is heavy on JavaScript. My preferred latest browser Mozilla Firefox does not work with it -- no pictures are displayed and...
5
by: antonyliu2002 | last post by:
Hi, It looks like so many people are having problems with the javascript submit in firefox. I searched around, but haven't found a solution yet. Mostly, people were saying, try this or try...
9
by: =?Utf-8?B?Sm9obiBCYWlsZXk=?= | last post by:
I have a ASP .Net page that allows moving around items on the page through javascript. This page works fine in IE. In FireFox however, I have found that if the page is using XHTML 1.0...
3
by: Mufasa | last post by:
Can anybody suggest websites that talk about what you need to do to make an IE site also work under Firefox. What things are allowed and what aren't - that type of thing. TIA - Jeff.
5
by: Herkum | last post by:
I created this generic AJAX Handler to work with Firefox and IE. However, it seems that somewhere in updating Firefox to 2.0.0.9 that the handler assigned to onreadystatechange is no longer getting...
5
by: Faizmysore | last post by:
This code works good in IE, function multiuser() { document.frmOpenInteraction1.Create.disabled=true; document.frmOpenInteraction1.hidmultiuser.value="Yes"; var r =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.