Note that there are some explanatory texts on larger screens.

plurals
  1. POsetInterval works online on same sytem (with 2 browsers open) but not online on separate systems
    text
    copied!<p>I have a setinterval code updating a div. This works fine when tested in two separate browsers on the same system but when I test online on say a separate mac and PC and it stops. </p> <p>The code is as follows:-</p> <p>Javascript:</p> <pre><code> function setupAjaxIntervalDiscuss(){ setInterval(function() { var datastring = 'refreshchat=true&amp;projid=' + proj_id + '&amp;uid=' + uid; ajaxUpdateDiscussion(datastring); }, 2000); } function ajaxUpdateDiscussion(ajaxdata){ $.ajax({ type: "POST", url: "uploaddata.php", data: ajaxdata, success: function(data){ $("#discussresult").html(data); refreshNav();//Updating a scrollbar styled with JS } }); } </code></pre> <p>PHP(this update correctly just here for ref) :</p> <pre><code> if(isset($_POST["refreshchat"])){ $user_id= $_POST['uid']; $proj_id=$_POST['projid']; echo '&lt;img class="closeddiscuss" src="images/closey.png" title="close" alt="close"/&gt;'; $get_discuss_query = "SELECT * FROM discuss INNER JOIN user ON discuss.user_id=user.user_id WHERE discuss.project_id=$proj_id ORDER BY discuss_id DESC"; $get_discuss_result=mysql_query($get_discuss_query); while($row=mysql_fetch_assoc($get_discuss_result)){ $text = nl2br($row['discuss_text']); $name = $row['user_name']; $user_profileimageurl = $row['user_profileimageurl']; echo '&lt;div class="discussbubble"&gt;&lt;p&gt;'.$text.'&lt;/p&gt;&lt;img class="smallprofileimage" src="'.$user_profileimageurl.'" alt="user profile image"/&gt; by '.$name.'&lt;/div&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