I am trying to study the jquery class, but I have a hard time debugging an object because I can’t see the element inside of it
JavaScript
x
7
1
$("#birds").autocomplete({
2
source: "search.php",
3
select: function (event, ui) {
4
alert(ui);
5
}
6
});
7
it returns [object Object].. 🙁 My question is how can I alert the object so that I can see the element?
Advertisement
Answer
i recommend you use FireBug for debugging javascript. then you can just do
JavaScript
1
2
1
console.log(ui)
2
and it’ll log the object in a form you can expand