In order to make the internal function accessible to outside functions
you'll have to make it the property of some object. There are numerous
choices: you could make it a property of the String object, Array object,
Function object, the function that contains it, or any other Javascript
built-in object or existing object that allows you to assign new properties
to it.
function parentName()
{
function String.childName()
{
}
Quote:
}
The inside function above has to be accessed as String.childName().
function parentName()
{
function parentName.childName()
{
}
Quote:
}
The inside function above has to accessed as parentName.childName(). Note
that in order to access the inside function from outside code the outside
function has to called at least once. This is because the inside function
isn't set as an object property until the outside function is called.
: Hi all,
:
: does anyone have already experienced it :
:
: i'd like to make function within function like
:
: function ParentName()
: {
: function ChildName()
: {
:
: }
: ChildName();
: }
: ParentName()
:
: I checked it and it seem working fine
:
: But, does anyone know if its possible to call ChildName() function outside
: of the ParentName() function.
:
: i d like to do it into a timeout purpose because :
: function ParentName()
: {
: function ChildName()
: {
: setTimeout('ChildName()',20)
: }
: ChildName();
: }
: ParentName()
:
: It's not working because the browser can't retrieve ChildName...
:
: Does anyone have any clue?
:
: Thanx a lot
:
: Laurent Goffin
: http://www.petrochemicals.atofina.com/
:
:
: