View Full Version : How to call a function from a conditional
Basicly, I need to say:
If this equals that, then do function test().
if(this==that) {
test();
}
Thanks
ACJavascript
04-08-2003, 12:58 AM
your right on target Saj
if(this==that){
CallFunction()
}
It works for me and all of my scripts :D
Then what exactly would I do?
if(this==that){
CallFunction(test)
}
or
if(this==that){
Calltest()
}
ACJavascript
04-08-2003, 01:13 AM
you would put it like this
if(this==that){
Test()
}
----
function Test(){
alert("Hi there,, I was called by a condition.")
}
Jason
04-08-2003, 01:14 AM
it depends on if the function takes a parameter or not. if it does then there is someting in between the parenthesis otherwise there is nothing in between them.
Jason
Ohh duh. The first thing you said worked for me. I was actually putting it in the wrong function at first. I'm really going crazy.
Thank though. :)
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.