video #42 - Advance PHP | Just AJAX

2 months ago
21

We are using AJAX to get data. AJAX is used to create more interactive applications. The function is triggered by the JS ‘onkeyup’ event.

First, check if the input field is empty. If it is clear the content of the placeholder it will exit the function.

Now, if the input field is not empty it creates an XMLHttpRequest object.
Then it creates the function to be executed when the server response is ready. Then it sends the request off to a PHP file that you created on the server. You can send your variable value to the PHP file.

Loading comments...