How to JSON decode array elements in JavaScript?

前端 未结 7 732
盖世英雄少女心
盖世英雄少女心 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-30 09:30

    I decode JSON this way:

    eval( 'var from_json_object = ' + my_json_str + ';' );
    

提交回复
热议问题