From the course: jQuery Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Solution
- [Narrator] Let's look at the solution I came up with for this challenge. And remember, it's okay if your solution is different from mine. What's important is that you take a look at the various techniques and see how they work so that you can use the one that's best for you, or you can see how to come up with your own. So let's open the code for the finished version of the challenge, and what we had to do in this challenge was load the JSON data for the products. And then find the right product data to display in our placeholders in the product information section. So I decided to use the getJSON AJAX function to do this. So I'm gonna scroll down below the other challenge solutions. And my call to getJSON, loads the product-data. json file, which is at the same level as this page. And then uses the dot done method, and you could have used a different version, you could have used a callback, it's up to you. But I used the dot done method to specify a function to handle the successful…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.