JavaScript AJAX Basics (retiring) Programming AJAX Processing JSON Data

Evin Hendry
Evin Hendry
6,092 Points

How does widget.html link to our widget.js and index.html files? I was wondering how it works without links.

I like to mess around with the workspaces and try to recreate them from memory so I fully understand what's going on, and I couldn't help but notice that widget.html doesn't appear to be linked to any of our other files. Does it not have to be linked if there are matching IDs between HTML files or something? Am I just not finding the link?

2 Answers

Martin Park
Martin Park
12,792 Points

There is no widget.html file in the workspace project? In the video Dave refers to a widget.html file to show what the hypothetical designer gave us. It is basically a mock up of what the finished file should look like. We do not need it in this example.

If you are meaning where does the Employee information come from it is specified in the the AJAX Open Request and dealt with in the AJAX callback function:

xhr.open('GET', 'data/employees.json');

Evin Hendry
Evin Hendry
6,092 Points

Oh, the answer was right in front of me the whole time! Thank you for your response!