• Image 1
  • Image 2
  • Image 3
  • Image 4
  • Image 5
  • Image 6
  • Image 7




Wednesday, July 4, 2012

TUTORIAL JAVASCRIPT - EVENT FOR NEWBIE

Hii.. welcome again in
We Are Knowledge

Manage of Event is capability javascript for known event or moment-moment in web page., and then it manage or doing a procces suitable conditional. In javascript to be found many Event like as : click, double click,  out of page, moving mouse, and other.

Event in javascript always using by programmer for add in web’s page.. Usually for more nice blog or moving we from one page to other page.

This sintaks “event”:
Name_event = “Javascipt_code”

Example:

<html>
<head>We Are Knowledge<br>
<title>Tutorial Javascript -
Event For Newbie</title>
</head>
<body>
<a href =
"http://www.have-fun-and-enjoy.blogspot.com"
onclick="alert('Hello Visitor')">W-A-K</a>
</body>
</html>


Look on.. If we click W-A-K, then we move to have-fun-and-enjoy.blogspot.com. That using event “onclick”.  And add alert (“hello visitor”). Alert want to appear when we click “W-A-K”.
In javascript was present many Event. And we can put in page.. And This event :
  • Onbiur
  • Onchange
  • Onclick
  • Ondblclick
  • Onerror
  • Onfocus
  • Onkeydown
  • Onunload
  • Onsubmit
  • Onselect
  • Onresize
  • Onreset
  • Onmouseup
  • Onmouseover
  • Onmouseout
  • Onmousemove
  • Onousedown
  • Onload
  • Onkeyup
  • Onkeypress

Hahaha…Very much event in javascript… But I just want giving you some event.
Ok.. Let’s Go…

  1. ONCLICK
Example :
  1. To Apearr alert
<html>
<head>We Are Knowledge<br><br>
<title>Tutorial Javascript -
Event For Newbie</title>
</head>
<script>
function inform()
{
alert("Hai Visitior")
}
</script>
<form>
<input type="button" name="w-a-k"
value="Click-Me" onclick="inform()">
</form>
</body>
</html>

  1. Change Background
<html>
<head>We Are Knowledge<br><br>
<title>Tutorial Javascript -
Event For Newbie</title>
</head>
<form name="go">
<input type="radio" name="w-a-k"
onclick="document.bgColor='green'">
<input type="radio" name="w-a-k"
onclick="document.bgColor='blue'">
<input type="radio" name="w-a-k"
onclick="document.bgColor='yellow'">
</form>
</body>
</html>


  1. ONLOAD
Onload want work if a web page was done loaded… It to appear… And if before web page web all loaded was stoped.. “onload” not want to appear.
Example:
<html>
<head>We Are Knowledge<br><br>
<title>Tutorial Javascript -
Event For Newbie</title>
</head>
<body onload=
"alert('This Page succesfull Loaded')">
</body>
</html>


  1. ONUNLOAD
Onunload want to appear if user closing this web.
Example:
<html>
<head>We Are Knowledge<br><br>
<title>Tutorial Javascript -
Event For Newbie</title>
</head>
<body onunload=
"alert('Thanks.. Good Bye')">
</body>
</html>


Ok.. Just it... I hope you understand.. If Not understand, please leave comment. and please wait.. I want answer..

If You will download source code..

click this for download tutorial in document.

Thanks Visitors... 

No comments:

Post a Comment