Easy Tutorial
❮ Cpp Inline Usage Verilog2 Lower Power Design ❯

JS/jQuery Methods for Refreshing an iframe

Category Programming Techniques

  1. To refresh an iframe using JavaScript, you can use the following method:
    document.getElementById('some_frame_id').contentWindow.location.reload();
    

Example:

<iframe id="myframe" width="100%" frameBorder="0" src="https://www.tutorialpro.org" scrolling="no"></iframe>
<input type="button" onclick="javascript:refreshFrame();" value="Refresh Frame" />

<script type="text/javascript">
&lt;!--
function refreshFrame(){
    document.getElementById('myframe').contentWindow.location.reload(true);
}
//-->
</script>
  1. To refresh an iframe using jQuery, you can use the following method:
    $('#iframe').attr('src', $('#iframe').attr('src'));
    

** Click to Share Notes

Cancel

-

-

-

❮ Cpp Inline Usage Verilog2 Lower Power Design ❯