Note that there are some explanatory texts on larger screens.

plurals
  1. POI can't get JSON object from response to getJSON ( jQuery )
    primarykey
    data
    text
    <p>I'm new to JSON , I have php page (server side) which include information formatted in JSON and I want to get these information in client side ( html page ) , I found an example using this function 'getJSON' in jQuery to do the same , but I think I'm missing something when using it because I'm not getting the response I want (Actually I'm getting nothing) this is the php code : </p> <pre><code> &lt;?php //header('Content-Type: text/xml'); header('Content-type: application/json'); ?&gt; { "file": { "filename" : "Test.txt", "fileCreatingDate" : "15-7-2013", "fileModifyDate" : "20-8-2013", "filesize" : "3002345", "filetype" : "Text", } } </code></pre> <p>I believe I should mention that this was php page with xml content and what I did is changing the xml format to json format , and here is the client side code :</p> <pre><code> &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script src="http://code.jquery.com/jquery-1.9.1.min.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/jquery-migrate-1.1.0.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="response"&gt; &lt;p id="responseParagraph"&gt;Base text&lt;/p&gt; &lt;/div&gt; &lt;script&gt; //172.25.10.99 is the server ip $.getJSON('http://172.25.10.99/list2.php', function(data) { $('#responseParagraph').append("&lt;p&gt;"+data.responseMessage+" &lt;/p&gt;"); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I would like to receive JSON object to be parsed later , what I'm trying to say is : I want do something close to xmlhttprequest and parsing the response but in JSON instead . could you please help ?? I'd really appreciate it .</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload