Note that there are some explanatory texts on larger screens.

plurals
  1. POIs this a jQuery bug, or am I missing something?
    primarykey
    data
    text
    <p>I am using jquery-1.3.2 in an AJAX web application. I use the jQuery ajax <code>$.post()</code> method to submit requests to the server.</p> <p>On the server I am using php to build an array and then <code>json_encode</code> the answer. Then on the client I use the callback function of the AJAX post method to process the response.</p> <p>All works well until I use the <code>$.post()</code> method to send variables to the server. If I send variables to the server, the response I get back is [object Object] and therefore I am unable to parse it. I have a work around at the moment that when posting variables I request a HTML response and then I parse that.</p> <p>So the code involved taken from my site is:</p> <p>The Jax call: </p> <pre><code>$.post("inc/sendfeedback.php", {NAME: name,TYPE: type,EMAIL: email,COMMENT: comment}, function(data) {PostData(data);}, "json"); </code></pre> <p>So the PostData code looks like this:</p> <pre><code>function ProcessData(data) { //alert(data); var jo = eval("(" + data + ")"); if(jo.result == "true") { if(jo.data != "" &amp;&amp; jo.element != "") { $(jo.element).html(jo.data); } } SMessage(jo.error); } </code></pre> <p>If I uncomment the above code the alert with have in it [object Object].</p> <p>if I remove the Post variables from the call it works fine.</p> <p>The server code look like this:</p> <pre><code>$arr = array ("result" =&gt; $result,"data" =&gt; $data,"error" =&gt; $error,"element" =&gt; $element); echo(json_encode($arr)); </code></pre> <p>Is this a bug with the jQuery library, I tried it with the 1.2 version however its was still present there? I also search the jQuery site and can not find anyone having this issue.</p> <p>So I assume I am missing something. But what?</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.
    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