I am encountering a JavaScript error:
"[object Object]" TypeError: invalid 'in' operand a
whenever I attempt to perform an AJAX request using the following code:
.data("ui-autocomplete")._renderItem = function( ul, item ) {
return $( "<li class='submitmore' ></li>" )
.data( "item.autocomplete", item )
.append('<p class="searchdata" onClick="asd(\'' + item + '\')">'+item.value+'<div class="clear"></div>');
};
function asd(itemnew){
console.log(itemnew);
$.each(itemnew, function (key, value) {
console.log("item : "+ key + " value : " + value);
});
}