473,748 Members | 6,664 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Mozilla javascript error: function is not defined

Hi!

Everything works fine with Opera and IE, but not with Mozilla 1.7.3 and
Firefox 1.0 PR. When I call a function previously defined inside another
function I've got "function is not defined". Why? TIA,

Bernhard.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jul 23 '05 #1
2 3886
"Bernhard Georg Enders" <bg*****@hotmai l.com> writes:
Everything works fine with Opera and IE, but not with Mozilla 1.7.3
and Firefox 1.0 PR. When I call a function previously defined inside
another function I've got "function is not defined". Why?


Most likely because functions defined inside other functions can only
be seen inside those other functions. However, then it's weird that
it works in other browsers.

Anyway, it's impossible to tell without seeing the actual code.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #2
Lee
Bernhard Georg Enders said:
Everything works fine with Opera and IE, but not with Mozilla 1.7.3 and
Firefox 1.0 PR. When I call a function previously defined inside another
function I've got "function is not defined". Why? TIA,


Maybe because Mozilla (like myself) can't imagine why you would
define a function inside another function unless you intended to
limit its scope.

Are you sure IE and Opera are calling internal functions?
The following simple example throws errors in IE, Opera and Firefox:
<html>
<body>
<script type="text/javascript">
function alpha(){
function beta(){
alert("beta");
}
beta();
}
alpha();
beta();
</script>
</body>
</html>

Jul 23 '05 #3

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

Similar topics

2
5996
by: Peter | last post by:
Hello, First of all, sorry for all the code. I don't know how to explain my problem without it. I have a javascript function which can build a webpage dynamically. A striped down version of the function looks like this: BEGIN CODE
2
5405
by: For Example: John Smith | last post by:
Hello! Javascript beginner here, looking for some help. I discovered this problem tonight while playing with my site using Mozilla. I don't have Netscape on this computer but I assume this problem would exisist there as well. I am interacting with a Java applet (open source, which I did not write) using javascript. The author of the applet has provided basic information regarding how javascript can be used to manipulate the applet.
10
3603
by: tony kulik | last post by:
This code works fine in ie and opera but not at all in Mozilla. Anybody got a clue as to how to get it right? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <script language="JavaScript" type="text/javascript"> function show(that) { if (box.style.visibility=='hidden') { that.style.visibility = 'visible'}; }
4
4916
by: Pai | last post by:
hello there, I am trying to rersize the window it works find in IE but doea not work with mozilla window.attachEvent(onload,MWSOnLoad); window.onload = function (MWSOnLoad) { alert('hello'); window.resizeTo(810,750); top.outerWidth=810;
15
5854
by: Johan | last post by:
Hi, I've been working on the following piece of code and it works fine in IE and Opera, dut keep getting the same error in Firefox. Can anyone tell me what's wrong with this code? What I'm trying to do is rewrite the left (navigationframe) and load a page on the right (mainframe). tia, Johan
6
3618
by: LRW | last post by:
I have a Javascript that makes a tablerow visible ot invisible, that works fine in InternetExplorer, but in Mozilla it's unresponsive and I get the following Javascript Console error: Error: itemeditrow is not defined Source File: editform.php Line: 45 Below is the Javascript, and a section of the HTML for that tablerow. I don't get it. It looks defined to me. What am I missing?
4
6447
by: Dmitry | last post by:
Hello, Sometimes on js code execution Mozilla 1.5 prints in JS concole the following error: "Error: fn is not defined" where "fn" is the function name surely defined _before_ the line that produces error. The fn body and error line both live in the same *.js file.
15
21364
by: prabhdeep | last post by:
Hi, Can somebody explain, why in following code, i get "event not defined" error funcTest(sMenu) { doument.getElementById('id1').addEventListener('mousedown', function(){ click(sMenu, event); }, false); }
0
8987
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
9534
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9366
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9316
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
9241
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
8239
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...
0
4597
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
4867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2777
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.