calling a function with a parameters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • localp
    New Member
    • Jun 2008
    • 8

    calling a function with a parameters

    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...
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by localp
    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...
    Code:
    function menu() {
    var form = // get the form here
    max(form); //calling max(form) from the function menu
    }
    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.

    Comment

    • rnd me
      Recognized Expert Contributor
      • Jun 2007
      • 427

      #3
      Code:
      function max(form){
       return "this is the code that will be returned";
      }
      
      function menu(){
         alert(String(max));
      }
      
      menu()



      shows:

      "function max(form) {
      return "this is the code that will be returned";
      }

      Comment

      Working...