473,394 Members | 1,679 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,394 software developers and data experts.

getElementById problem in FF

I am getting this error in Firefox.. what does this mean, pls? I have
never seen a JavaScript error like this..

Error: uncaught exception: [Exception... "Illegal operation on
WrappedNative prototype object" nsresult: "0x8057000c
(NS_ERROR_XPC_BAD_OP_ON_WN_PROTO)" location: "JS frame ::
file:///C:/Documents%20and%20Settings/fdelrio/My%20Documents/cc/site/index.html#
:: chgLang :: line 43" data: no]
basically this is on a show-div/hide-div function to switch between two
languages..

line in question is: var div_top_lang = getElem(curr_div_lang);
(where getElem = document.getElementById)

url:
http://www.francesdelrio.com/cc/index.html
(function calls and functions all here..)

language-switch works fine in IE.. but not in FF... I have used
getElementById many times just in this way, as for ex. these two urls,
which both work fine in FF..

http://www.francesdelrio.com/hbl/
http://www.francesdelrio.com/dhtml/sonnets.html

thank you..

Frances


Jul 23 '05 #1
2 2526


Frances Del Rio wrote:
I am getting this error in Firefox.. what does this mean, pls? I have
never seen a JavaScript error like this..

Error: uncaught exception: [Exception... "Illegal operation on
WrappedNative prototype object" nsresult: "0x8057000c
(NS_ERROR_XPC_BAD_OP_ON_WN_PROTO)" location: "JS frame ::
file:///C:/Documents%20and%20Settings/fdelrio/My%20Documents/cc/site/index.html#
:: chgLang :: line 43" data: no]
basically this is on a show-div/hide-div function to switch between two
languages..

line in question is: var div_top_lang = getElem(curr_div_lang);
(where getElem = document.getElementById)


getElementById is a method of the document object and should be used as
such whereas your code unbinds the function from the document object by
assigning it to a variable and then calls it. That does not work and
causes that error message.
Use
document.getElementById(curr_div_lang)
or if you think you need to shorten that then you can create a variable e.g.
var doc = document
and then call
doc.getElementById(curr_div_lang)

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
Martin Honnen wrote:

Frances Del Rio wrote:
I am getting this error in Firefox.. what does this mean, pls? I have
never seen a JavaScript error like this..

Error: uncaught exception: [Exception... "Illegal operation on
WrappedNative prototype object" nsresult: "0x8057000c
(NS_ERROR_XPC_BAD_OP_ON_WN_PROTO)" location: "JS frame ::
file:///C:/Documents%20and%20Settings/fdelrio/My%20Documents/cc/site/index.html#
:: chgLang :: line 43" data: no]
basically this is on a show-div/hide-div function to switch between two
languages..

line in question is: var div_top_lang = getElem(curr_div_lang);
(where getElem = document.getElementById)

getElementById is a method of the document object and should be used as
such whereas your code unbinds the function from the document object by
assigning it to a variable and then calls it. That does not work and
causes that error message.
Use
document.getElementById(curr_div_lang)
or if you think you need to shorten that then you can create a variable
e.g.
var doc = document
and then call
doc.getElementById(curr_div_lang)


my gosh Martin, I could have sworn I did try this (getting it out of
var..) and it hadn't worked, probably some other stupid error... thank
you so much!!

Frances

Jul 23 '05 #3

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

Similar topics

1
by: lawrence | last post by:
This PHP function prints out a bunch of Javascript (as you can see). This is all part of the open source weblog software of PDS (www.publicdomainsoftware.org). We had this javascript stuff...
12
by: lawrence | last post by:
The following function correctly makes everything invisible but then fails to turn the one chosen DIV back to visible. I imagine I'm getting the syntax of the variable wrong? I've tried this with...
4
by: lawrence | last post by:
Can anyone tell me why this code works in Netscape 7.1 but not in IE??? <SCRIPT type='text/javascript'> function makeVisible(nameOfDiv) {...
7
by: PaulB | last post by:
Good Morning everybody, I'm trying to adapt a tutorial script that will handle the behaviour of an "Expanding/Contracting" site-navigation menu. The code that seems to handle the expansion and...
3
by: davidkarlsson74 | last post by:
Error: document.getElementById("folderMenu").cells has no properties File: http://www.volkswagen.se/tillbehor/js/foldermenu.js Rad: 49 The function activates different DIV:s, but doesn't seem to...
1
by: Andre Ranieri | last post by:
Hello, I'm trying to set up an ASP.NET 2.0 form where the user enters values in WebControls.TextBoxes for amount owing, interest and late fees and a JavaScript function totals the three values...
4
by: dr1ft3r | last post by:
Hey guys, I'm building a site for a landscaping business down the street and can't seem to get part of the code functioning correctly. The code fails on line 68 where I make a reference to an...
13
by: RommelTJ | last post by:
Hi, My website (http://www.justiceinmexico.org/indextest.php) looks good in Firefox, but horrible in IE, and I think it's because of an error in the javascript of a free web ticker I got off the...
5
by: jhappeal | last post by:
I do not know Javascript that well so I might be going about this the wrong way. Any help would be appreciated. This function attempts to hide the options inside of the optgroup tag of the second...
1
by: vikD | last post by:
Hello, I'm really bad at javascript but I managed to get the code below to work in IE but firefox gives this error... Error: document.getElementById.formall is undefined Basically use the...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.