Using event-driven AJAX


show more Using event-driven AJAX provides you with in-depth training on Developer. Taught by Ray Villalobos as part of the JavaScript and AJAX show less
please wait ...

Using event-driven AJAX

You can use AJAX to update items on a page as a result of some type of event. Events in JavaScript can happen as a result of a user action, like a click or a mouse over an element, and some are triggered by other events, like when something has finished loading or when a key is released. You can use JavaScript to capture the event when it happens and trigger a series of commands. So first, we're going to clean up our HTML a little bit. We'll take out this AJAX page h1. It's not really doing very much. So let me go ahead and save that. And then I'm going to take my script and wrap it inside a function.

So right now this script is executing whenever it gets to it in the index.html file, which is at the very end. So this page loads and then the script runs right here, so all this is executing right then. So what we'll do is prevent that from happening, by putting everything inside a function. So we'll grab all those code and we'll paste it right there. Let me go ahea...

Using event-driven AJAX
Video duration: 4m 36s 1h 12m Intermediate

Viewers:

Using event-driven AJAX provides you with in-depth training on Developer. Taught by Ray Villalobos as part of the JavaScript and AJAX

Subjects:
Developer Web
Software:
Ajax JavaScript
Author:
please wait ...