AJAX (reading)
The 4 main steps of AJAX
- DOM (Document Object Model) Event Occurs
- An interaction occurs on the webpage (#div link or button is clicked)
- The JS running on the page has an event listener for the interaction
$("#new-fortune").on("click", function(event) {
event.preventDefault()
prevents the page from executing the button/link's function within the event listener function
- The HTTP Request Occurs through AJAX