In JavaScript, what is event handling? What are the two categories of events?
In java script we could capture events on do a few operation on the basis of which particular event. For example we need to load some data on web page then along with the help of event handling we could do this operation through using onLoad event.
We can put Event handlers within the body of web page and also in attributes of HTML.
From the attribute we could call any JavaScript function that will do his operation and come back. Now we can also interact along with server side with the help of AJAX in JavaScript function.
In-Line Event Handling
We can place event handlers within the BODY part and also in HTML attributes the event handlers attributes consist of 3 elements the event handler, equal sign and a string of JavaScript statement enclosed within quotes (single or double). And one more thing these should be put within one line without newline because of this sophisticated event handling is not possible along with in-line event handling.