Our project has infinite scrolling, but it has a major bug. The function is called every single time the user scrolls and that is sending too many duplicate Ajax requests. Learn an important technique for preventing additional Ajax requests from executing until the first request is complete.
- [Narrator] In the previous movie,…we added infinite scrolling, but we ran into a problem.…The problem is that our code is sending too many…ajax requests, and we need to learn…how to prevent that from happening.…The problem we ran into,…you can see we have blog post 104, 105 and 106,…but before that we also had 104, 105 and 106.…You may be wondering well how did that happen,…what's going on here?…We can actually see the problem a little bit better…if we come over to blog posts, and we make it…into a slow server by simulating that,…by telling this script that it ought to sleep…for two seconds.…
So now, let's go back over here, to firefox,…let's reload our page, and the first page loads,…we got blog post 101, 102 and 103, we scroll down,…and it's loading, and we got 4, 5 and 6,…we got 104 again.…So what's happening there ?…Let's try it one more time, see if we can tell.…We get the first page, alright, now, I'm going to get…to the bottom, and I'm going to trigger it,…we're going to see it trigger,…alright we're getting close,…
- What is Ajax?
- Creating Ajax requests and responses
- Monitoring Ajax request state and events
- Responding to Ajax requests with HTML and JSON
- Building Ajax buttons
- Submitting forms with Ajax
- Implementing infinite scrolling
- Adding autosuggestions to text fields
Skill Level Intermediate
1. Ajax Defined
What is Ajax?5m 34s
2. Ajax Client
3. PHP Server
4. Ajax Button
5. Ajax Form Submission
6. Infinite Scrolling
7. Search Autosuggest
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.