Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript AJAX Basics AJAX Concepts Review AJAX Security Limitations

Samuel Kleos
seal-mask
.a{fill-rule:evenodd;}techdegree
Samuel Kleos
Front End Web Development Techdegree Student 13,728 Points

WDYM: View a page through a web server in order to preview the results?

"When adding standard AJAX requests to your pages, you need to view that page through a web server in order to preview the results."

  1. How do you view a page through a web server?
  2. What does it mean to 'preview' results?

Thanks in advance. ✌️

1 Answer

Rachel KTY Johnson
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Rachel KTY Johnson
Treehouse Project Reviewer

Hey Samuel Kleos thanks for your question!

In the first or second video of this course we learnt that "AJAX is the process of sending a request to a web service, and receive a response back, and then do something with that response".

Then in the previous video, we learnt "if you build a page on your computer that uses AJAX and open up [the html file] directly in your web browser, the AJAX won't work". When we do this, we are simply opening up a static HTML file that has some CSS applied to it, and maybe a Javascript file. Website/pages that have AJAX requests will need to be accessed through a web server. It is no longer a static HTML file (it's dynamic!). You'll come across web servers and how they work if you dive into Express (Javascript back-end framework) or Flask (Python back-end framework)

"Previewing results" in this case just means loading up the page to see it.