As a newcomer to developing Firefox Add-Ons, my initial project involves calling an external API in two steps:
Step 1) Retrieve data from the API.
Step 2) Use the data retrieved in Step 1 to make another call to the same API for additional information.
Initially, I used XMLHttpRequest in synchronous mode because I believed that waiting for Step 2 required this approach. It involved two separate calls to the function handling the API requests, utilized XMLHttpRequest, and parsed the responses successfully.
However, after exploring documentation on the Mozilla Development Network advocating for asynchronous XMLHttpRequest usage, I decided to give it a try.
I based my new implementation on resources like multiple XMLHttpRequests and others, resulting in the code snippet provided below.
My query is: Is this the correct method to follow? Should I return to using synchronous mode? While the current setup functions properly, something about it feels off in terms of aligning with standard AJAX practices...
// Include your code here