Is there a way to know that the elements are on a document before I try to access them with JQuery?
Code Snippet:
var s = new AjaxCall(someurl);
s.oncomplete = function(response) {
var container = $('container_id');
container.innerHTML = response;
var ul = $('some_id'); }
The response is some HTML returned by the Ajax call.
This response updates the contents of a div
and then I access an element that was created by the innerHTML
(the ul
in the code).
If the response is large, I believe there would be times that some elements would not be rendered when I will try to access them. Does domready
work for AJAX calls, and could this solve my problem?