I am grabbing data through a jQuery Ajax call, and displaying it on the page. I need to wait for both the DOM to load and for the Ajax call to complete before I can use the data to display it on the page. Can an Ajax call ever complete before the DOM has loaded? I’m just trying to determine where I need to put my method that will manipulate the DOM and use the data I’m getting back.
Share
I would wait until the DOM has loaded before making your AJAX call. While it is unlikely that the DOM READY will take longer than the AJAX call, it’s just good practice.