# Just need a little extra to make this iframe refresh just once

**URL:** <https://forum.kirupa.com/t/just-need-a-little-extra-to-make-this-iframe-refresh-just-once/324885>\
**Category:** Uncategorized\
**Created:** [September 13, 2011, 9:36pm UTC](https://forum.kirupa.com/t/just-need-a-little-extra-to-make-this-iframe-refresh-just-once/324885 "2011-09-13T21:36:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eabigelow](https://avatars.discourse-cdn.com/v4/letter/e/eada6e/32.png) [@eabigelow](https://forum.kirupa.com/u/eabigelow)\
**Post date:** [September 13, 2011, 9:36pm UTC](https://forum.kirupa.com/t/just-need-a-little-extra-to-make-this-iframe-refresh-just-once/324885/1 "2011-09-13T21:36:50Z")

</div>

Hi–

I have found a neat trick to refresh an iframe in an html page, but I just need one little twist to make it work just right. I would like to make the iframe content refresh just once, no matter how many times the link is clicked…

Right now, I have this in the head:

> \<script type=“text/javascript”\>  
> function refreshIframe(el) {  
> var f = document.getElementById(el)  
> var rsrc = f.src  
> f.src=“about:blank”  
> f.src=rsrc  
> }  
> \</script\>

And this is the link which, when clicked, refreshes the iframe every time it is clicked:

> \<a href=“#page\_7c” onclick=“refreshIframe(‘test’); return false”\>

“test” is the id of the iframe.

I am sure how to make the iframe refresh just once the first time the link is clicked is really simple, but it escapes me… Many thanks!
