AJAX with Pure JavaScript

by Devansh


Posted on 02 Mar 2018 07:03:32 (5 months ago)


In today's time everyone uses the AJAX feature with jQuery but it is also important to learn some basic concept first. In this section, I will guide you to the use of AJAX with pure JS. Now before moving to AJAX first understand two things in AJAX i.e. Ready States and Status. There are five ready states including with zero. They are as follow.

Ready States:-
0: Request Not Initialized
1: Server Connection Established
2: Request Recieved
3: Processing Request
4: Request Finished And Response Is Ready

Status:-
200: OK
404: The Page Was Not Found

Methods For Using AJAX:-
Normally we use two methods and you are also aware of i.e. GET and POST method. In next section I will show you the use of AJAX by using GET method and then afterwards POST.