jquery to check if returned data object is empty

Posted by user253530 on Stack Overflow See other posts from Stack Overflow or by user253530
Published on 2010-04-07T02:02:49Z Indexed on 2010/04/07 2:13 UTC
Read the original article Hit count: 334

$("#post").live("click",function()
{
    $("input:checkbox[name='bookmarkid']:checked").each(function()
    {
         $.post("php/socialbookmark-post.php", {bookmarkID: $(this).val()},function(data)
         {
              if(data != "") alert(data);
         });
    });
});

the php file outputs some text only if something goes wrong. The checking that I do fails if the data is empty and displays an empty message. I need to fix this. Any ideas?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript