Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If the <code>iframe</code> is <a href="https://developer.mozilla.org/docs/Same_origin_policy_for_JavaScript" rel="nofollow">same-origin</a>, you can force a full page reload using</p> <pre><code>iframe.contentWindow.location.reload(true);//The argument "true" will force all loaded resources, such as images, to be re-checked for expiry at the server </code></pre> <p>↪ <a href="http://jsfiddle.net/M6sCP/" rel="nofollow">View an example at jsFiddle</a></p> <p>↪ <a href="https://developer.mozilla.org/docs/DOM/window.location#Methods" rel="nofollow">More information at the Mozilla Developer wiki</a> <hr>If you have control over the HTTP headers sent for the page in the <code>iframe</code>, you can also <a href="https://stackoverflow.com/q/49547/1419007">instruct the browser not to cache it in the first place</a>.<hr>Furthermore, most web pages completely ignore parameters in the <a href="https://en.wikipedia.org/wiki/Query_string" rel="nofollow">query string</a> for which they have no handling code, so you could add a random value or a timestamp to the query string to make sure the browser sees it as a "new" page and does not use the cached copy:</p> <pre><code>if(iframe.src.indexOf('timestamp') &gt; -1){ // Check if we still have a timestamp in the URL from a previous refresh iframe.src = iframe.src.replace(/timestamp=[^&amp;]+/, 'timestamp=' + Date.now()); // And if so, replace it instead of appending so the URL doesn't grow too long. }else{ // Else we will append the timestamp iframe.src += (iframe.src.indexOf('?') &gt; -1 ? "&amp;" : "?") + 'timestamp=' + Date.now();// If the URL contains a ?, append &amp;timestamp=...; otherwise, append ?timestamp=... } </code></pre> <p>Use <code>new Date().getTime()</code> instead of <code>Date.now()</code> if <a href="http://caniuse.com/#search=Date.now" rel="nofollow">support for older browsers</a> is important.</p>
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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