Results 1 to 5 of 5

Thread: javascript question

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2002
    Location
    Dallas, Texas
    Posts
    62

    javascript question

    how do you include variables when calling a function for instance in vb you got:
    [vb code]
    Function ThisIsMyFuncton(variable1 as string, variable2 as integer)

    End Function
    [/vb code]

    --I tried this in javascript but i think i am not declaring the variables correctly or something

    Code:
    <script language="javascript">
             Function Testing(var Variable1, var Variable2) {
    
              }
    </script>
    shouldnt this work, can anyone tell me y it dont?

  2. #2
    Member
    Join Date
    Jan 2003
    Posts
    44
    You need a lowercase function.

  3. #3
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    You don't need the var either. I've never really seen any examples with it, so I'm not sure whether it can be there or not.

  4. #4

    Thread Starter
    Member
    Join Date
    Nov 2002
    Location
    Dallas, Texas
    Posts
    62

    Lightbulb Another JavaScript Question

    Is there a way to make an equvilant to Public Variables with javascript what i really need is an Array who's value can be seen in all functions

    thanks
    oOBlackOrbOo

  5. #5
    Lively Member
    Join Date
    Dec 2002
    Location
    southwest pennsylvania
    Posts
    65
    global variables can be made anywhere outside of a function.

    <script...>
    var myArray=new Array()
    function addArray(stuff)
    {
    myArray(myArray.length)=stuff
    }
    function getArray(index)
    {
    return myArray(index)
    }
    </script>
    if you choose not to decide you still have made a choice!

    RUSH rocks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width