473,808 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.getEle mentById() 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.getEleme ntById("disp"); ?

Why does it work with IE and not FF?

Thanks,

Tmuld
Jun 27 '08 #1
6 1195
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.getEle mentById() 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.getEleme ntById("disp"); ?
Try this:
var e=document.getE lementById("dis p");
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.getEle mentById() 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.getEleme ntById("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.getEle mentById("disp" );
if (e)
{
// ...
}

or

var e = oNug.getElement sByName("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[zeroBasedNumber OrName].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 bugRiddenCrashP ronePieceOfJunk = (
navigator.userA gent.indexOf('M SIE 5') != -1
&& navigator.userA gent.indexOf('M ac') != -1
) // Plone, register_functi on.js:16
Jun 27 '08 #3
VK
On Apr 24, 7:08 pm, Tmuldoon <tmuld...@splic ed.comwrote:
FF returns this error:

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

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

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

Well, the error description seems very clear. Don't use
document.all("d isp") and use document.getEle mentById("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...@y ahoo.comwrote:
Element referenced by ID/NAME in the global scope. Use W3C standard
document.getEle mentById() instead.

Well, the error description seems very clear. Don't use
document.all("d isp") and use document.getEle mentById("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.getEle mentById("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...@y ahoo.comwrote:
>>Element referenced by ID/NAME in the global scope. Use W3C standard
document.getE lementById() instead.
Well, the error description seems very clear. Don't use
document.all(" disp") and use document.getEle mentById("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.getEle mentById("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******* *******@Pointed Ears.de>.
PointedEars
--
var bugRiddenCrashP ronePieceOfJunk = (
navigator.userA gent.indexOf('M SIE 5') != -1
&& navigator.userA gent.indexOf('M ac') != -1
) // Plone, register_functi on.js:16
Jun 27 '08 #7

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

Similar topics

6
3574
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 referenced in the script so I presume that Firefox needs to be added somewhere -- does anyone know how I could update this to be supported by Firefox? Thanks! <SCRIPT TYPE="text/JavaScript">
3
2959
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.. sorry for the long post ==
1
10638
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 parent window scroll bar. This code works perfectly fine in IE but not in Firefox.. The iframe does not resize according to the content. function resizeIframe(id)
11
3442
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 no buttons react to clicking. The website's helpdesk says it should work with Firefox, and could not offer any more advices. The JavaScript Console shows that there are numerous errors occuring. It looks like the web browser does not recognise...
5
77652
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 that or maybe blah blah or why do you wanna do that blah blah. I haven't seen a solution to this problem. OK, I am trying to share session objects between classic asp applications and asp.net applications. If you insist in asking why I
9
2000
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 Transitional as the doctype, you cannot set the style.left and style.top properties of image or div tags. If you remove the doctype from the page it works just fine, although I would rather not do this. You can work around this by setting the cssText...
3
1241
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
2151
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 called. This still works for IE. Can someone help me add to this so that I can get it working with Firefox again? var ASYNCH = true; var REQUEST_TYPE = 'POST'; var AJAX_URL = '/ajax.cgi'; function httpRequest() {
5
6473
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 = showModalDialog('popup.htm','NEW', 'dialogWidth:400px;dialogHeight:155px;dialogLeft:200px;center:1;help: no; resizable: no; status: no; scroll: no;'); window.document.frmOpenInteraction1.ticket.checked=false;...
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9600
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10114
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9196
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7651
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6880
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5548
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5686
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.