私はそうしようとしていますbreak
/応答がnullreturn false
の場合、そうすることによって:$.post()
....
$('#order_list li > div').remove(); // is to remove `no_data` or `search_box` when clicking on the next `li`
$.post('do.php', { OP: "news_search", category: cat_id },
function(data_response){
console.log(data_response); //outputs null if nothing retrieved, or data if otherwise
if(data_response==null) //stop code if the response is null
{
alert('if works');
$(this).append(no_data).show('slow');
return false; // doesn't do the trick
}
}, "json");
//if not null, continue with this
if( ! $('.search_box').exists())
{
$(this).append(search_box).show('slow');
}
....
しかし、あなたが読むことができるように、私のコードはうまくいきません。何か案は?
アップデート
if(data_response==null)
作品、それはreturn false
その仕事をしないものです