Question: I have a php script which produces the JSON object.

In my jquery I am using this code to call the php script.

```
  $.getJSON("/st/std.php",
   function(data){
    alert(data);
       $("myspan").text(data);
   }
  );

```

How Do i get the Data from THE JSON Encoded in php File .In the form Iam entering some code which will perform the ajax lookup to a php file This is the Json Object iam producing it in php

Suppose if we input the "AAA" in the textbox it should fetch "AAA-ANAA".It should search the JSOn encoded object and fetch the label.

```
[{"label":"AAA-ANAA (PF)","value":"AAA"},
{"label":"AAB-ARRABURY (AU)","value":"AAB"},
{"label":"AAC-AL ARISH (EG)","value":"AAC"},
{"label":"AAE-ANNABA (DZ)","value":"AAE"}}

```

Answer: 
Make sure that the response header includes:

```
Content-Type: application/json

```

and not

```
Content-Type: application/json; charset=utf-8

```

In IE9 I had the experience where the data returned from `$.getJSON` was `undefined`, even though in the Network pane you could see the request being made and the response body containing the desired JSON.
To see what ("object object") actually holds, replace alert(data); with alert(data.toSource());.

Say your php page returns {"a":"value"}, then $("myspan").text(data.a); would stick "value" in your span.

To pass a parameter, put it in the query string: "/st/std.php?param=value".