What Is AJAX? Breaking it Down.
As any beginner programmer sets off on their journey it’s important to understand AJAX, and what it can do for you in your program. Let’s jump in!
AJAX allows you to update content on a web page without loading a new page. (Real life examples: Google maps- if you make a request it just adjusts/updates the current page, Twitter- Loads only a certain amount of posts if you keep scrolling down it will add more posts to the current page)
Some server-side languages AJAX works with include Python, PHP, Ruby, & Cold Fusion.
AJAX has been around since 1999, back then it wasn’t known as AJAX but as an XML HTTP Request Object(also sometimes shortened to XHR)
XML aka. Extensible Markup Language
Originally XML was seen as the format server responses should be sent in.
How AJAX works:
- Create XML HTTP Object
- Define a callback function ( programming you want to run when program returns a response)
- Open a Request, this is where you define if the request method is a “get” or “post” request, and you also need to include the URL where the request is sent
- Send the Request.
I hope this gave you some insight into the basics of AJAX, and what it’s all about. Thanks for reading and happy hacking to you!