|
-
Feb 18th, 2003, 02:25 PM
#1
Thread Starter
Member
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?
-
Feb 18th, 2003, 03:04 PM
#2
Member
You need a lowercase function.
-
Feb 18th, 2003, 03:28 PM
#3
Frenzied Member
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.
-
Feb 18th, 2003, 07:09 PM
#4
Thread Starter
Member
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
-
Feb 18th, 2003, 07:57 PM
#5
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|