By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,340 Members | 1,395 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,340 IT Pros & Developers. It's quick & easy.

Mozilla javascript error: function is not defined

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
"Bernhard Georg Enders" <bg*****@hotmail.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/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #2

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.