How to JSON decode array elements in JavaScript?

前端 未结 7 517
盖世英雄少女心
盖世英雄少女心 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:33
    var obj = jQuery.parseJSON('{"name":"John"}');
    alert( obj.name === "John" );
    

    See the jQuery API.

    0 讨论(0)
提交回复
热议问题