Showing posts with label Functions In JavaScript. Show all posts
Showing posts with label Functions In JavaScript. Show all posts

Wednesday, 25 December 2013

Calling a function from another function in JavaScript

Calling a function from another function In JavaScript. Let see How to call Function with another function.

Code For Calling a function from another function in JavaScript

Calling a function from another function
Calling a function from another function
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 
<html>
<head>
</html>
<body>
 
<script type="text/javascript">
function doFirst() {
 document.write("I am First Function!");
}
function doSecond() {
 document.write("I am Second Function");
}
 
function start(){
 doFirst();
 doSecond();
}
start();
</script>
 
</body>
</html>
Output Screenshot
Calling a function from another function
Calling a function from another function (Screenshot2)
Firstly I had function name doFirst which i will called first inside the function. Now in First function I just echo out message on screen I am first means when ever i will call function it will echo me I am first Function. Then had a second function with message I am second function.Then I had function start which will call functions.
function start(){
doFirst();
doSecond();
}
The Above Code is declaration how we can declare function with another function or can also call function inside function in JavaScript.
Then we had call start(); We defined function which will call our doFirst Function Then it will call doSeond function In Such a way in JavaScript we can call function inside the function. Or calling function with another function in JavaScript.

Thursday, 31 October 2013

Functions In JavaScript

Functions In JavaScript
Functions In JavaScript. Now a functions is basically a mini program. Its a mini program that you can use anytime you want through out about your java-Scripting. For example you are making YouTube they probably have a function to play the video whenever you hit the play button. They have a function a pause the video whenever you pause the button. They have a function a function to add a vote to thumbs-up whenever you thumbs-up button as you can see a function can be called not only as soon as a webpage is load but it can be called anytime you want Now Let see example for Making functions in JavaScript's Programming Language.

Read More Extra Tutorials