[jQuery] binding solution
I am having a binding issue. I've read enough in the jQuery docs and
on this forum to have a cursory understanding. Without many examples
to refer to, I am unsure of how to implement Live Query in order fix.
I'm calling this refreshLabels() function each time a form checkbox is
clicked. On the first click, alert() and replaceWith() act as desired,
but on subsequent clicks, only alert().
function refreshLabels(element, slug) {
$.ajax({
url:'/labels/sidebar/' + element + '/' + slug + '/1',
cache:false,
success:function(html){
alert('fired');
$('#sidebar-category-list').replaceWith(html);
}
});
}
I've made a number of attempts at applying the livequery() function to
replaceWith(), but get a "replaceWith is not a function" error each
time.
Can someone please show me the proper syntax needed to use Live Query?
Thanks!