English 中文(简体)
如何与 jQuery 一起钻入嵌入的阵列和对象?
原标题:How to drill down into nested arrays and objects with jQuery?

我试图使用 Worknik AS API 来将给定单词的每个“文本”定义与 JUS 和 API 此处的“ 3 ” ( URL param 中的限制) 拼凑, 从而将给定单词的每个“ 文本” 定义转换为3 : < a href=" http://jsfiddle. net/ p4xF3/2/" rell=" rel=“ nofollow” > http://jsfiddidle. net/p4xF3/2/ < a > I can get me want to control.log out, 但似乎无法使用正确的语法将每个“ 文本” 节点( URL parm) 钻入阵列中。 我想将这些结果附在代码的 div 中, 可能没有什么意义, 但我会更清楚一点, 如果你看到上面的JUSiddiscledle 链接, 并用那里存在的代码搜索一个反对 Wordnik APnik AP 的英语词。 。 之后, 您应该看到我指的是什么。 。谢谢 。

最佳回答

您正在获取一组 json 对象, 所以您必须在此重复, 从每个对象中拉出“ 文本 ” 。 您基本上已经这样做了, 当您使用每个 jquery 函数时, 但是您可以将它改变为像这样的传统循环 :

for (var i = 0; i<cbfunc.query.results.json.json.length; i++)
{
    var textNode = cbfunc.query.results.json.json[i].text;
}
问题回答

最后,我感到很傻,因为这与我钻入物体和阵列的方式无关,而与我使用每种物体和阵列的方式无关。

$(cbfunc.query.results.json.json).each(function () {
            var wordl = this.text;
            var tmpl =  <p>  + wordl +  </p> ;
            $(tmpl).appendTo(".tryout");
});




相关问题
C# Networking API s [closed]

Lately I ve been looking for a good networking API i could possibly use and/or reference some of the code within, but i have mere luck searching for some on Google/Bing. Hopefully somebody here has ...

getting XML from other domain using ASP.NET

I m fairly new to ASP.NET. And I was wondering how I could go about getting xml from a site (Kuler s API in this case), and then post the result using AJAX? So what I want here, is to be able to do a ...

Most appropriate API for URL shortening service

I ve just finished an online service for shortening URLs (in php5 with Zend Framework); you can enter an URL and you get an short URL (like tinyurl and such sites). I m thinking about the API for ...

UML Diagram to Model API

I need to create a diagram to document a RESTFul API that build, which UML diagram should I use? Thanks in advance,

How best to expose Rails methods via an API?

Let s say I have a model foo, and my model has a publish! method that changes a few properties on that model and potentially a few others too. Now, the Rails way suggests that I expose my model over ...

简讯

我是否可以使用某些软件来建立简便的航天国家服务器,最好是在 Java? 所有我都希望我的航天国家服务机在任何要求中都用同样的IP地址来回答。

About paypal express checkout api

In this picture,there are 3 main steps:SetExpressCheckout,GetExpressCheckoutDetails and DoExpressCheckoutDetails,I m now sure SetExpressCheckout is to be called by myself,what about ...

热门标签