I have one link that makes an ajax request and it prints by XHR request another link same at this one before cliked
so it’s like a loop:
starting XHR from
<a href="javascript:void(0)" class="doXHR">do XHR</a>
than into Ajax success function i repeat into my html this link:
<a href="javascript:void(0)" class="doXHR">do XHR</a>
but when i output the same link to html by success function of previous doHXR call it doesn’t allow me to do another(doXHR ajax call)
so if i click on same link,but same link is generated from ajax,it doesn’t allow me to send another(same) doXHR request… :/
any idea?
sorry for my bad english 😛
It seems to me that you assign an event listener to your
do XHRlink and it looks like the callback function is changing that link with the code you mentioned.When doing so, the original event listener attached to that link is gone and you’ll have to reattach it. Another possibility is to use jQuery’s
.livefunction, which also fires events on elements attached to the DOM after ‘binding’ the event listener: