Wednesday, July 23, 2014

JavaScript introduction

Hey.....

today we'll talk about a very important thing in web developing which is javascript its not like the "java" programming language what is it then?
  • the usage of javascript is to transfer the events that happen in the HTML page to actions so for example in our Sign up Form after we fill the information what will happen if we click the submit button for now nothing will happen because that event there isnt a handling for it a handler which change it into action
  • javascript is easy and simple it has some special features and the most important thing in java is function 
  • Function: is a specific instructions that happen together and we call that function to start and begin .
  • javascript code can be written in the <head> tag or in an external file and then include it into our HTML page just like the external CSS file we did before lets see this simple example :

  • ONE IMPORTANT THING: after we write our function the thing we want to happen we should know when and how to call it thats why there's a action handle for buttons there's onclick function this is another function that calls our function when we click on the button .

 

and first we'll see the button when we open this code in our browser but nothing will happen until we click on it: 
and when we click our button this will show :
Note: this might change from a browser to browser so this is in Google ghrome but it wont be the same in firefox or other browsers ..



No comments:

Post a Comment