Hello, I have a question here. Is there any way to apply some javascript behavior fired by an event (click), on elements that have been loaded on page via ajax load()??? How?
@ktsixitauthorJul 30.2009 — #kor, I know how to use such kind of functions. I have tried to use a "click function" but it's not working because it seems that javascript is not able to "see" these elements that have been loaded with ajax.
For example if I load a div via ajax and try to add a click behavior on it, it seems that it's not there - it doesnt exist, for javascript.
Maybe these elements do not belong to DOM and they still remain external data. I don't know.
@KorJul 30.2009 — #Well yes. The AJAX response is either a string or an XML object. In both cases you do not have a DOM valid insert. I guess you have used the innerHTML method to write the response to the document. But innerHTML is not a standard DOM method and it does not insert always the elements into the DOM tree.
I guess you should write the event at the other end of the request, in the server-side application code.
@TcobbJul 31.2009 — #How are you loading the DIV from the AJAX response? Is it response text or XML? And what is being done with it? How are you inserting it into the document? You are not providing enough information for anyone to give you a quick explanation.