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

calling a function with a parameters

P: 8
i have a function called max(form) in the javaScript file .. and this is been called fromt he HTML page ...

and below the HTML page there is a button.. where when u click it, the function menu () should be called ... but

in the function menu we should call the function max(form) .. how do we do it ??

idea in brief .. how do we call the function max(form) from the function menu..

Question 2. ) calling a function means, textual pasting of the codes of a function...
Jun 11 '08 #1
Share this Question
Share on Google+
2 Replies


10K+
P: 13,264
i have a function called max(form) in the javaScript file .. and this is been called fromt he HTML page ...

and below the HTML page there is a button.. where when u click it, the function menu () should be called ... but

in the function menu we should call the function max(form) .. how do we do it ??

idea in brief .. how do we call the function max(form) from the function menu..

Question 2. ) calling a function means, textual pasting of the codes of a function...
Expand|Select|Wrap|Line Numbers
  1. function menu() {
  2. var form = // get the form here
  3. max(form); //calling max(form) from the function menu
  4. }
2.) NO. Calling a function is just writing the function name and passing the required parameters if any.

P.S A Javascript tutorial is not a bad thing to go through at this stage.
Jun 11 '08 #2

rnd me
Expert 100+
P: 427
Expand|Select|Wrap|Line Numbers
  1.  
  2. function max(form){
  3.  return "this is the code that will be returned";
  4. }
  5.  
  6. function menu(){
  7.    alert(String(max));
  8. }
  9.  
  10. menu() 



shows:

"function max(form) {
return "this is the code that will be returned";
}
Jun 11 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.