Skip to content

Commit 0175494

Browse files
Correct “AJAX” into “Ajax”
1 parent 286dca9 commit 0175494

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

readme.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -905,24 +905,24 @@ fetchingPosts
905905

906906
#### Explanation
907907

908-
When you do an *AJAX request* the response is not synchronous because you want a resource that takes some time to come. It even may never come if the resource you have requested is unavailable for some reason (404).
908+
When you do an *Ajax request* the response is not synchronous because you want a resource that takes some time to come. It even may never come if the resource you have requested is unavailable for some reason (404).
909909

910910
To handle that kind of situations, ES2015 has given us *promises*. Promises can have three different states:
911911

912912
- Pending
913913
- Resolved
914914
- Rejected
915915

916-
Let's say we want to use promises to handle an AJAX request to fetch the resource X.
916+
Let's say we want to use promises to handle an Ajax request to fetch the resource X.
917917

918918
##### Create the promise
919919

920-
We firstly are going to create a promise. We will use the jQuery get method to do our AJAX request to X.
920+
We firstly are going to create a promise. We will use the jQuery get method to do our Ajax request to X.
921921

922922
```js
923923
const xFetcherPromise = new Promise( // Create promise using "new" keyword and store it into a variable
924924
function(resolve, reject) { // Promise constructor takes a function parameter which has resolve and reject parameters itself
925-
$.get("X") // Launch the AJAX request
925+
$.get("X") // Launch the Ajax request
926926
.done(function(X) { // Once the request is done...
927927
resolve(X); // ... resolve the promise with the X value as parameter
928928
})
@@ -951,7 +951,7 @@ xFetcherPromise
951951
})
952952
```
953953

954-
```.then``` is a method that once called will put the xFetcherPromise in **pending** state. When called, the promise body runs and in this case an AJAX call is being done.
954+
```.then``` is a method that once called will put the xFetcherPromise in **pending** state. When called, the promise body runs and in this case an Ajax call is being done.
955955

956956
If it succeeds, *resolve* is called and the function passed as ```.then``` parameter is executed.
957957

0 commit comments

Comments
 (0)