-1

I need to load following json data file in a javascript file using ajax

here is my json data

[
{
    "mobile_no": "9633127725"

},
{
    "mobile_no":"9605895175"
},
{

    "mobile_no": "8590823209"
}
]
appu
  • 116
  • 7
  • Sharing your research helps everyone. Tell us what you've tried and why it didn't meet your needs. This demonstrates that you've taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer! Also see [how to ask](http://stackoverflow.com/questions/how-to-ask) – Cerbrus Jul 21 '15 at 05:59
  • possible duplicate of [load json into variable](http://stackoverflow.com/questions/2177548/load-json-into-variable) – jasonscript Jul 21 '15 at 06:15

1 Answers1

0

In success function of $.ajax():

$.ajax({
  //url
  //type
  
  success: function(data) {
    var returnData = JSON.parse(data);
  }
});

Now you could use returnData like an array with value is Json Data from data.

Neo
  • 1,469
  • 3
  • 23
  • 40