In this code demonstration, students apply the three fundamental concepts learned so far to create a simple HTML page which will load new text from another file asynchronously using Ajax.
- [Instructor] Now that we know how to handle Ajax requests,…server responses, and also how to inspect the current state…and trigger code whenever that state changes,…we're ready to put it all together in our first example.…We'll create a simple HTML page,…which will load new next from another file asynchronously…by using Ajax.…I'm going to start out with a bit of code…in a couple separate files.…You can see that I've got them in a directory here…called ajax_text and the first file is index.html…and the 2nd is new_content.txt.…
These are also included in the exercise files…if you have access to those.…They're pretty simple.…Let's open them up in the Atom text editor to take a look.…So when I drag the folder into Atom,…it opens it up in project view.…Let's look at new_content.txt first.…It just a very simple text file…with just a single sentence in it.…This is the new content which has been loaded by Ajax.…That's the content that I'm going to be loading in.…So you can use any text you want for that.…Here's the HTML file.…
- 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.