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

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.

3434


How do you insert record into scripting using siebel crm

5626


what is the Structure of an ANT file?

2383


What is the procedure for installing USP-35 on my compure?

2184


How applet differ from Swings in java ?

2120


how can we move to the next column in excel sheet in file operation using descriptive programming inQTP?

2294


Would you tell me that what is test script? and how to write it? are there some templates?

2313


why script is client dependant.

2499


How can you convert QTP 8.2 scripts to QTP 9.2. Please give some inputs ASAP.

2886


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

2249


can I name the build.xml with any name? if so how can I invoke ?

2595


how do invoke OS task through ANT?

2816


why do u need an ANT?

2518


how do u define in ur build.xml If I need to execute a task before executing my task?

2334


In sap script, created 1 form but when its went to production system , client want some changes in 1 (ex - addrss) window, what we will do?

1583