如何提醒JavaScript对象 [英] how to alert javascript object

查看:46
本文介绍了如何提醒JavaScript对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试研究jquery类,但由于无法看到其中的元素,因此调试对象很困难

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

$("#birds").autocomplete({
    source: "search.php",
    select: function (event, ui) {
        alert(ui);
    }
});

它返回[object Object] .. :(我的问题是如何提醒该对象以便可以看到该元素?

it returns [object Object].. :( My question is how can I alert the object so that I can see the element?

推荐答案

我建议您使用 FireBug调试JavaScript .那你就可以做

i recommend you use FireBug for debugging javascript. then you can just do

console.log(ui) 

它将以您可以展开的形式记录对象

and it'll log the object in a form you can expand

这篇关于如何提醒JavaScript对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆