我的arp欺骗程序可以在半分钟左右的时间内完美运行,然后停止接收网络数据包,而仍然像以前一样运行。
它会打印出所有数据,并且在短时间后似乎与网络断开连接,我无法找到断开连接的原因
$(document).ready(function(){
$('#search').keydown(function(){
$.getJSON("data.json", function(data){
var search = $('#search').val();
var regex = new RegExp(search, 'i');
var currentCategory = "Logistics";
var output; //<-- This is undefined
$.each(data, function(key, val){
if ((val.title.search(regex) != -1) && val.category == currentCategory) {
output += "<li><img src='"+val.img+"'><h2>"+val.title+"</h2></li>";
}
});
$('ul.news').html(output || "<li> No Records found</li>");
// Used "||" to set alternate html if value of 'output' variable is [null, undefined, 0, '']
});
});
});