Note that there are some explanatory texts on larger screens.

plurals
  1. POProblem with jquery load function
    primarykey
    data
    text
    <p>I have a page where I use the jquery load function to load data from a php file. The problem is that it does not always return the correct number of results. I have tried receiving the data straight from the php file and that worked perfectly. What could cause this problem with the load function?? It should only return a max of 5 entries.</p> <pre><code>s_showLoader(); $("#s_content").load("sdata.php", {s_page:1, user:fbusername}, s_hideLoader); </code></pre> <p>The show and hide loader functions just show and hide a gif loader. page is the page of pagination to display and user is just used to verify the user is logged in.</p> <p>UPDATE 1: Here is example of what the sample return looks like. It is in a while loop and is generated for each entry that is returned.</p> <pre><code>&lt;table border="0"&gt; &lt;tr&gt;&lt;td width="500"&gt; &lt;?php if($s_rows['name']){ echo $s_rows['name']; }else{ echo "User"; } ?&gt;&lt;?php echo " | &lt;a id='s_datedata".$s_idnum."'&gt;".$s_rows['date']."&lt;/a&gt;"; ?&gt; &lt;div class="s_label&lt;?php echo $s_idnum; ?&gt;"&gt;&lt;?php echo $s_display; ?&gt;&lt;/div&gt; &lt;br&gt;&lt;a href="#" class="s_entry-info" id="&lt;?php echo $s_idnum; ?&gt;"&gt;More Info...&lt;/a&gt;&lt;br&gt; &lt;div class="list_con" id="s_condata&lt;?php echo $s_idnum; ?&gt;"&gt;&lt;?php echo $s_rows['content']; ?&gt;&lt;/div&gt; &lt;div class="list_tags" id="s_contags&lt;?php echo $s_idnum; ?&gt;"&gt;&lt;?php echo $s_rows['tags']; ?&gt;&lt;/div&gt; &lt;/td&gt; &lt;td width="10" align="right"&gt;&lt;!-- delete button if correct user is logged in--&gt; &lt;?php if($user &amp;&amp; ($fbuser == $s_rows['fb_id']) ){ //show delete button ?&gt; &lt;a href=""&gt;&lt;img src="close-icon.png" title="Click here to delete your listing" class="delopt" id="&lt;?php echo $s_idnum; ?&gt;" onclick="return del_list(&lt;?php echo $s_rows['id']; ?&gt;,&lt;?php echo $s_rows['fb_id']; ?&gt;)" height="25" width="25" alt="delete" border="0"&gt;&lt;/a&gt; &lt;?php }else{ //echo $fbuser."|".$rows['fb_id']; } ?&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>UPDATE 2: This is the only POST variable in the php file. The rest of the data comes from the standard facebook api.</p> <pre><code> $s_page_num = floor($_POST['s_page']); </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.
 

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