Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
JavaScript
function hello()
{
   call();
   alert("hello");
}
function call()
{
  alert("call");
}


in the above code , i just want the browser to execute alert("call") not alert("hello").

any help
thanks in advance
Posted
Updated 8-May-13 9:38am
v2
Comments
Zoltán Zörgő 8-May-13 15:31pm    
Than don't ad that alert.
RaisKazi 8-May-13 15:50pm    
See Solution-1 below and be polite.

Well, then remove or comment out alert("hello"); don't forget to call either of these functions at the point where there are already declared (that it, below).

—SA
 
Share this answer
 
Comments
RaisKazi 8-May-13 15:38pm    
To the point answer, 5ed.
Sergey Alexandrovich Kryukov 8-May-13 15:39pm    
Thank you, Rais.
Not difficult for anyone, right? :-)
—SA
RaisKazi 8-May-13 15:42pm    
yup, probably OP had a half-sleep last night, :).
bhawin parkeria 8-May-13 15:52pm    
yup
i didn't slept last night.

do you guys have girlfriend?
Sergey Alexandrovich Kryukov 8-May-13 15:53pm    
Have a best of luck, man. (OK, are you accepting the answer formally (green button?))
—SA
function hello()
{
call();
if(call())
{
alert("hello");
}
}

function call()
{
alert("call");
return true;
}


the alert("hello") will be called only when the call() will return true
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900