Note that there are some explanatory texts on larger screens.

plurals
  1. POajax form handling an array
    primarykey
    data
    text
    <p>am trying to handle an array comes from php file after submitting the form data , the value of data after submitting the form is = ARRAY but i cant use this array in any way , any idea how can i handle this array !!!! </p> <p>Javascript : </p> <pre><code> $('#file').live('change',function(){ $('#preview').html(''); $('#preview').html('&lt;img src="loader.gif" /&gt;'); $('#data').ajaxForm(function(data){ $(data['toshow']).insertBefore('.pic_content').hide().fadeIn(1000); }).submit(); }); </code></pre> <p>PHP : </p> <pre><code>.... ....etc echo json_encode(array('toshow'=&gt;somedata,'data'=&gt;somedata)); </code></pre> <p>JSON String come from server</p> <pre><code>{"toshow":"\r\n\t\t\t\t\r\n\t\t&lt;table class=\"out\"&gt;\r\n\t\t\t&lt;tr &gt;&lt;td class=\"img\"&gt;&lt;a title=\"2012-06-02 01-22-09\" rel=\"prettyPhoto\" href=\"img\/2012-06-02 01-22-09.284.jpg\"&gt;&lt;img src=\"img\/thumb\/2012-06-02 01-22-09.284.jpg\"\/&gt;&lt;\/a&gt;&lt;\/td&gt;&lt;\/tr&gt;\r\n\t\t\t\r\n\t\t\t&lt;td&gt;\r\n\t\t\t\t&lt;table cellSpacing=\"1\" cellPadding=\"0\"&gt;\r\n\t\t\t\t\t&lt;tr&gt;&lt;td class=\"data\"&gt;&lt;span class=\"click\"&gt;2012-06-02 01-22-09&lt;\/span&gt;&lt;\/td&gt;&lt;\/tr&gt;\r\n\t\t\t\t\t&lt;tr&gt;&lt;td class=\"data\"&gt;&lt;span class=\"click\"&gt;Download&lt;\/span&gt;&lt;\/td&gt;&lt;\/tr&gt;\r\n\t\t\t\t\t&lt;tr&gt;&lt;td class=\"data\"&gt;&lt;a href=\"img\/2012-06-02 01-22-09.284.jpg\"&gt;&lt;span class=\"click\"&gt;View&lt;\/span&gt;&lt;\/a&gt;&lt;\/td&gt;&lt;\/tr&gt;\r\n\t\t\t\t&lt;\/table&gt;\r\n\t\t\t&lt;\/td&gt;\r\n\t\t\t&lt;\/tr&gt;\r\n\t\t&lt;\/table&gt;","span":"&lt;span class='text'&gt;&lt;img src='greencheck.png'\/&gt;2012-06-02 01-22-09 Uploaded ,File Size =152Kb &lt;\/span&gt;"} </code></pre>
    singulars
    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