3
我在查询LinkedIn JS API以返回人员列表。该列表作为JSON对象返回。这里是回调函数:访问JSON对象的问题
.result(function (result) {
profile = result.values[0];
// Do something with the first linkedin profile in the list...
});
对象“结果”返回类似如下:
{"values":[{"id":"123456","firstName":"Person","lastName":"One"}, {"id":"123456","firstName":"Person","lastName":"Two"}, {"id":"123456","firstName":"Person","lastName":"Three"}],"_total":3}
我见过的所有文件使用此语法从结果得到的第n项:
var profile = result.values[n];
这适用于大多数浏览器,但在IE中它抛出以下错误:
Microsoft JScript runtime error: Object doesn't support this property or method
有没有人有任何想法解决这个问题?
在此先感谢。
我在IE9测试,一切顺利。 – xdazz
你正在使用'profile = ...'还是'var profile = ...'? – Jochem
哪个版本的ie? – naveen