Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How can we return a value from User Defined Function ? For
Eg. we have 2 functions. In Fun1 i am getting 2 values (a,b)
and i am addding those 2 and storing in to another var (c).
Now i want to pass that var(c) to another function (fun2).
What will be the script?

Answer Posted / ganesh

<script language="javascript">
function add()
{
var a=parseInt(document.getElementById('x').value);
var b=parseInt(document.getElementById('y').value);
var c= a + b;
fun(c);
}
function fun(disp)
{
alert(disp);
}
</script>
</head>
<body>
Enter First Number:<input type="text" id="x" /><br />
Enter Second Number:<input type="text" id="y" /><br />
<input type="button" value="Add" onclick="add()" />
</body>



Am i right ??

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Someone who protect my excel file, m using ms office 2007 and windows 7 operating system, pls help me, how can i unprotect sheet

2314


Why we use Action Script(Multimedia Flash) rather than using other scripting languages (JAVA,VB...etc) ?

2817


why script is client dependant.

2458


Need a batch file or VB script to delete old (more than 90datys) roaming profiles

2301


how can i type the text message in compose box in yahoo mail using descriptive programming in QTP?

2125


why do u need an ANT?

2477


If we add regular expressions to a script recorded in QTP, will it effect the performance of the script?

2193


We have 1 web page with names column. I am giving the Service Providers1,2,3.... @ that time dynamically some no of names are displaying in the webpage and The Pop up windows are opening(No.of Pop Up windows=No.of Names). The names may be diffar for each and every Service Provders (Dynamically) How can we handle the Dynamic values?

2682


I have deducted tds on pay slip for employees ist month tell me how to deposit this amt to govt. by bank or any form is available fill the same and deposit the govt. department. Pls explain me which form to be used for deposit the same with due date.

3369


a="10.20.30.1" replace 1 with 45 in python using reg ex

1364


how can i get two different fonts in a single line

1996


what is the Structure of an ANT file?

2323


how do invoke OS task through ANT?

2747


How do you insert record into scripting using siebel crm

5566


why script is client dependant.

2218