PARSE JSON FILE WITH JQUERY ? NOT WORKING

jacob rasel

Total Post:88

Points:616
Posted by  jacob rasel
JSON 
 1816  View(s)
Ratings:
Rate this:
Hi Expert!

I am trying to parse json file in my phonegap application. 

here is my code

  $.getJSON('http://shobingg.com/cms/sites/php/message.json',
  function(data)
  {    
      $.each(data, function(i, item) {
          alert (item.message);
      });
      //$("#div-my-table").append("</table>");
  });

Please help me!
Thanks in advance! 
  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: Parse Json file with Jquery ? not working

    Hi Jacob!


    Try this:

    $(document).ready(function() {
        var url =  "http://www.shobingg.com/cms/sites/php/message.json";
        $.getJSON(url + "?callback=?", null, function(data) {
            console.log(data);
        });
    });

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!