Thursday 19 May 2011

JavaScript : Function Pre Defined Function User Defined Function




JavaScript : Function Pre Defined Function User Defined Function

Sample JavaScript


<head>
<script type="text/javascript" language="javascript">
alert("welcome")
</script>
</head>

Sample Java Script 2
<head>
<input type="button" value="click" onClick='alert("Button Clicked")'>
</head>

Function: Function is an set of executable statements and functions we are using for reasonability’s. Function divided into two parts.
*Pre Defined Function: This functions are nothing but building function which are available with languages. Ex: alert, presInt, evil
*User Defined Function: Functions defined by the programmers at the time of application development. By using this function keyword we can declare the functions. The syntax of function declaration is ..
Function<name>()
{
//Java Script Statement
}
SAMPLE JAVA SCRIPT 2
<script>
function fun1()
{
alert("PHP NOTES SCRIPT")
}
</script>
<input type="button" value="click" onClick="fun1()">

SAMPLE JAVA SCRIPT 3
<script>
function fun1(x,y)
{
alert(x+y)
}
</script>
<input type="button" value="click" onClick="fun1(10,20)">

SAMPLE JAVA SCRIPT 3
<script>
fonction fun1()
{
rval=fun2()
alert("rval")
}
function fun2()
{
x=100;y=200;k=x+y;return k
}
</script>
<input type="button" value="click" onClick="fun1()">

3 comments:

  1. sir upload three ajax chat program 1chat.html,2read.php,3page1.php please sir upload programme because my written program not work

    ReplyDelete
  2. sir,this program runs only in local server or webserver too.this program is runnig well in my localhost but when i uploaded it on webserver ,it is not reading the text file chat.txt

    ReplyDelete
  3. So there, that's my new Mother Earth avatar. Not sure how long php notess going to last but enjoying php notes while php notes does. So, my dear faphp noteshful readers, please don't abandon me. Do continue reading this blog and who knows, my anonymous blog might merge over wphp notesh this one.

    ReplyDelete