I enqueued the script through WordPress and checked the source, the JS file is only included once. Using Firebug, I see that the Post is only sent once. Using Console.log(response), it shows only the single result.
It’s outputting my results twice in the HTML though! What am I doing wrong?
$('#cpnsrch').bind('keyup',function(){
var srch_data = $('#cpnsrch').val();
if(srch_data.length > 2){
$.post(bctcdb.ajaxurl,
{
'action' : 'search-coupon',
'data' : srch_data
}, function(resp){
if( resp != $('#list-coupons tbody').html() ){
$('#list-coupons tbody').html(resp);
}
return true;
}, 'text');
}
});
I’m at a loss and can’t think of any other causes.
Here’s the site if that helps any.
Thanks!
-Daniel
edit: Oops, sorry for those that went to the link. I had it set so only logged in users could see the page. It should work for anybody now.
The issue is with your
<tbody>closing tag – you have another opening instead of</tbody>