Hello--
I have what seems a simple problem, but it's somehow not working out.
Here's the problem:
$(".pastebinLink a").livequery(function(){
$(this).bind('click', function(el){
$.ajax({
url: this.href,
type: 'post',
success: function(results, status) {
$(this).replaceWith(results);
}
});
return false;
});
});
The (X)HTML looks like this:
<td class="pastebinLink">
<a class="modal" href="/pastebin_items/14266/edit">
<img class="viewButton" src="/images/spacer.gif?1210022683"
alt="Spacer"/>
</a>
</td>
And the stuff returned from the Ajax post looks like:
<a href="/pastebin_items/14275/edit" class="modal"><img alt="Spacer"
class="viewButton" src="/images/spacer.gif?1210022683" /></a>
What I expect is that on success everything inside the <td> should be
replaced with the new stuff from the server. What am I missing?
Thanks (he says missing something obvious :)