1
 window.onload = function(){
 var outerFn = function ( oParam ){
 return oParam; 
 }
 var v = OuterFn( 2 );
 alert('V :'+v);
 }

In this function i always get OuterFn not defined. Whats going wrong ??? Can somebody tell me.

asked Jan 12, 2012 at 9:57
0

2 Answers 2

4

OuterFn and outerFn are different things as JavaScript is case sensitive, try it with a small o. Ie:

window.onload = function(){
 var outerFn = function ( oParam ){
 return oParam; 
 }
 var v = outerFn( 2 );
 alert('V :'+v);
}
Matt
75.4k26 gold badges156 silver badges181 bronze badges
answered Jan 12, 2012 at 9:58
Sign up to request clarification or add additional context in comments.

Comments

3

Your function is assigned to outerFn variable, so that's why you should call it:

var v = outerFn(2);

JavaScript is case sensitive.

answered Jan 12, 2012 at 9:59

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.