Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>it could be that your .php files are being cached locally by your browser. Consider appending a query string parameter to your requests: </p> <p><code>var randomnumber=Math.floor(Math.random()*11);</code></p> <p><code>xmlHttp2.open("GET","random3.php?someVar="+randomnumber,true);</code></p> <p>This way it will always be a "new" file being requested.</p> <p>edit: Be sure to generate the random number every time you wish to process the AJAX - the purpose is to create a "new request", so the random number code would be executed/computed each time prior to making the request</p> <p>edit: also because Include is a serverside directive - it may very well be your DOM is not complete @ time of execution </p> <p>edit 2: <strong>Try this</strong></p> <pre><code>&lt;?php header("Content-Type: text/html; charset=ISO-8859-15"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); ?&gt; &lt;script type="text/javascript"&gt; function homeload2(){ var xmlHttp2; try{ xmlHttp2=new XMLHttpRequest();// Firefox, Opera 8.0+, Safari } catch (f){ try{ xmlHttp2=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer } catch (f){ try{ xmlHttp2=new ActiveXObject("Microsoft.XMLHTTP"); } catch (f){ alert("No AJAX"); return false; } } } xmlHttp2.onreadystatechange=function(){ if(xmlHttp2.readyState==4){ document.getElementById('homeload2').innerHTML=xmlHttp2.responseText; setTimeout('homeload2()',10000); // JavaScript function calls AutoRefresh() every 10 seconds } } xmlHttp2.open("GET","random3.php",true); xmlHttp2.send(null); } // don't call Homeload here &lt;/script&gt; &lt;div id='homeload2'&gt; &lt;font size='1em'&gt; Random Number times 10:&amp;nbsp; &lt;?php include "random3.php"; ?&gt; &lt;/font&gt; &lt;/div&gt; &lt;script&gt; // call it here homeload2(); &lt;/script&gt; </code></pre>
    singulars
    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