Note that there are some explanatory texts on larger screens.

plurals
  1. POajax callback function return strange data format
    text
    copied!<p>I was expecting to see the data value which a variable I set for the ajax to communicate with my php file. but this is what I get</p> <pre><code>Saved: &lt;br /&gt; &lt;font size='1'&gt;&lt;table class='xdebug-error xe-notice' dir='ltr' border='1' cellspacing='0' cellpadding='1'&gt; &lt;tr&gt;&lt;th align='left' bgcolor='#f57900' colspan="5"&gt;&lt;span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'&gt;( ! )&lt;/span&gt; Notice: Undefined index: data in C:\wamp\www\ajaxExample\send.php on line &lt;i&gt;3&lt;/i&gt;&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align='left' bgcolor='#e9b96e' colspan='5'&gt;Call Stack&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align='center' bgcolor='#eeeeec'&gt;#&lt;/th&gt;&lt;th align='left' bgcolor='#eeeeec'&gt;Time&lt;/th&gt;&lt;th align='left' bgcolor='#eeeeec'&gt;Memory&lt;/th&gt;&lt;th align='left' bgcolor='#eeeeec'&gt;Function&lt;/th&gt;&lt;th align='left' bgcolor='#eeeeec'&gt;Location&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td bgcolor='#eeeeec' align='center'&gt;1&lt;/td&gt;&lt;td bgcolor='#eeeeec' align='center'&gt;0.0025&lt;/td&gt;&lt;td bgcolor='#eeeeec' align='right'&gt;249728&lt;/td&gt;&lt;td bgcolor='#eeeeec'&gt;{main}( )&lt;/td&gt;&lt;td title='C:\wamp\www\ajaxExample\send.php' bgcolor='#eeeeec'&gt;..\send.php&lt;b&gt;:&lt;/b&gt;0&lt;/td&gt;&lt;/tr&gt; &lt;/table&gt;&lt;/font&gt; $.ajax({ type: "POST", url: "send.php", data: { item : userInput } }) .done(function( data ) { alert( "Saved: " + data ); }); </code></pre> <p>php :</p> <pre><code>&lt;?php $data = $_POST['data']; echo $data; ?&gt; </code></pre>
 

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