How to JSON decode array elements in JavaScript?

前端 未结 7 671
盖世英雄少女心
盖世英雄少女心 2020-11-30 08:40

I have a JavaScript array that, among others, contains a URL. If I try to simply put the URL in the page (the array is in a project involving the Yahoo! Maps API) it shows t

7条回答
  •  时光取名叫无心
    2020-11-30 09:24

    Suppose you have an array in PHP as $iniData with 5 fields. If using ajax -

    echo json_encode($iniData);
    

    In Javascript, use the following :

    
    

提交回复
热议问题