Hi All,

I am facing a problem using the "getJSON" function. It works fine in
Internet Explorer but doesn't give any response in Fire Fox

Following is the Jquery code  I am using to access the php script
(jsontest.php) on my local apache server.

        $(document).ready(function(){

         $.getJSON(
            "http://localhost/dn-new/jsontest.php";,
            function(data,status){
                        alert("in call back");
                        alert(data);
            }
          );
       });

Following is the code in php file

<?php

$results = array("21" => array("url" => "www.blah.com/story1.html",
"title" => "JSON is sweeping AJAX world",
"viewed" => FALSE), "22" => array("url" => "www.blah.com/
story2.html",
"title" => "JSON is great", "viewed" => FALSE));


$jsonObject = json_encode($results);
echo $jsonObject;

?>

Am I doing any mistake ? please help


Thanks in advance,

Srinivas


Reply via email to