未捕获的TypeError:无法在'中使用'操作者

时间:2014-12-03 05:35:32

标签: javascript jquery

我需要什么

  • 我需要动态地在div中附加数组数据。

输出数组响应

 Array
           (
               [data] => Array
                   (
                       [0] => Array
                           (
                               [metadata] => Array
                                   (
                                       [summary] => Raj is the founder of  Accelerator, In first multi-city Tech Accelerator, backed by 20 iconic Digital founders and 5 leading venture funds from across the world. Rah is also the founder of Superangels network and curator of the Global Superangels Forum. He is the co-host and curator of Founders Forum India. Rahas made over 15 investments as an active and engaged angel investor.His journey has been a continuum of re-invention waves. In the first wave, he brought private radio (Times FM) to India in early nineties, and redefined Indian youth culture. In his second wave, he was at the cusp of early Internet culture in India and built Indim, the most valuable Internet business in India in 2005 (funded by Sequoia). In the third wave, Rah was at the centre of a massive transformation of the Indian film industry, where he oversaw (as President, Reliance Entertainment) the corporatization of mom and pop Bollywood businesses into multi-billion dollar enterprise. At Reliance, Rajesh found himself at the centre of cross-border investment and alignment between Hollywood and Indian Film Industry and one of the biggest investment deals (DreamWorks) in Hollywood. Currently in his fourth wave, Rajesh is building the vital building blocks of a nascent early stage startup ecosystem in India, and sees this as the biggest and most exciting challenge that he has faced in his life.Rajesh is an alumnus of Harvard Business School (AMP), and has a fellowship from London School of Economics.  Twitter URL: http://twitter.com/rajese: www.ga.com
                                   )

                           )

jquery代码

       var id=$('#eventID').attr('value');
        alert(id);
        $.ajax({
        type: "GET",
        url: "http://local.domain.com/app.php/ajax?for=speakers&id="+id,
            success: function(html)
            {
                console.log(html);
                $.each(html, function(key, value){
                console.log(key + ":" + value)
                })

            }
        });

我试图调试

console.log(html)之后的

输出是: -

XHR finished loading: GET "http://local.10times.com/app.php/ajax?for=speakers&id=25162".
  • 输出没有错误。
  • 但是当我使用foreach循环错误时。
  • $(" .speakers&#34)附加(HTML)。好吧没错。

我需要输出

 <div class="speaker">summary data</div>
 <div class="speaker">summary data </div>
<div class="speaker">summary data </div>
<div class="speaker">summary data </div>

错误

   Uncaught TypeError: Cannot use 'in' operator to search for '19240' in Array.

0 个答案:

没有答案