Today we are going to start new session,
Html & JavaScript function.
In this session following points are explain.
1.what is function.
2. How to called function within function.
3. How define global variable & use in function .
4. Use function within jQuery.
5. Calling ways of functions.
An function is set of code that use to solve specific problems, it defines all detail of point.
After checking an condition system display message whether you are go to school or not.
Suppose another example
About status is afternoon.
If you define variable before start function.
It says to be global or use global variables name.
If you are using jQuery simply called function.
There are different ways to call function,
Onclick like html event.
Specific of function:
1.easy of use
2. One function call number of times
3. Is form short code
4. Reduce web loading time.
View more details on next session
Don't forget share.
Html & JavaScript function.
In this session following points are explain.
1.what is function.
2. How to called function within function.
3. How define global variable & use in function .
4. Use function within jQuery.
5. Calling ways of functions.
An function is set of code that use to solve specific problems, it defines all detail of point.
Ex. Today I am going to school.
Answer:
Function school ()
{
Var auto= "charges of auto";
Var ready = "dress wearing & all prepared";
If (auto=='not ')
{
Alert ("you should try again");
}
Else
{
Alert ("go fast auto ready");
}
}
In above function if you see details of function variable passes auto position.Answer:
Function school ()
{
Var auto= "charges of auto";
Var ready = "dress wearing & all prepared";
If (auto=='not ')
{
Alert ("you should try again");
}
Else
{
Alert ("go fast auto ready");
}
}
After checking an condition system display message whether you are go to school or not.
Suppose another example
Function abc()
{
If(var a== 'hello')
{
alert ("good morning");
}
Else
{
Function status ()
{
Var after = ' afternoon ';
}
}
abc();
Above function execute & if you alert variable after it displays message {
If(var a== 'hello')
{
alert ("good morning");
}
Else
{
Function status ()
{
Var after = ' afternoon ';
}
}
abc();
About status is afternoon.
If you define variable before start function.
It says to be global or use global variables name.
If you are using jQuery simply called function.
$(document).ready(function()
{
Abc();
});
In this way function use within jQuery. {
Abc();
});
There are different ways to call function,
Onclick like html event.
Specific of function:
1.easy of use
2. One function call number of times
3. Is form short code
4. Reduce web loading time.
View more details on next session
Don't forget share.
THANK YOU FOR THE INFORMATION
ReplyDeletePLEASE VISIT US
Website Designing in Bangalore