Skip to content

This will be an exercise in handling async requests in JS using 3 different approaches.

Notifications You must be signed in to change notification settings

AlexandruVoica/basic-search-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AJAX exercise

stability-stable GitHub last commit

Description

This will be an exercise in handling async requests in JS using 3 different approaches:

  • XHR
  • jQuery
  • Fetch API

Tools

The only external library I am using is jQuery. Also I make use of some ES6 features like modules, template literals etc.

Scope and process

After all, I ended up using all 3 approaches specified above together with 3 different APIs:

  • Unsplash API - for loading photos from Unsplash
    https://unsplash.com/documentation
    
  • Wikipedia API - for fetching descriptional snippets from Wikipedia
    https://www.mediawiki.org/wiki/API:Main_page
    
  • News API - for loading articles from various news sources around the web
    https://newsapi.org/docs
    

I've written each async request almost 2 times and so it made me realize what the pros and cons of each approach is. For example, using XHR might pose a problem because of CORS limitations.

Conclusion

My final conclusion is that jQuery is extremely easy to use, versatile and still very much relevant.

About

This will be an exercise in handling async requests in JS using 3 different approaches.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published