/    Sign up×
Community /Pin to ProfileBookmark

I’m currently working on a little pet project of mine. What I have is 20 or so Iframes on a single page, and what I want to happen is each iframe to refresh independantly.

So far nothing I’ve tried has worked, though I have been able to make the entire page refresh.

Any idea on how I can get it to work? So far I’ve done the meta refresh thing, but that refreshes the whole page.

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@iniquity101Feb 16.2004 — [URL=http://forums.webdeveloper.com/showthread.php?s=&threadid=27798&highlight=refresh+Iframe]http://forums.webdeveloper.com/showthread.php?s=&threadid=27798&highlight=refresh+Iframe[/URL] may help
Copy linkTweet thisAlerts:
@Cobra_CommanderauthorFeb 16.2004 — That helps, but I'm confused by what to put for it. By that I mean, the page I have has nothing but

<iframe src=""> about 20 of those. Where would I put the

<script>

function doa() {

// where name is the id of the iframe

document.getElementById('name').src = document.getElementById('name').src


}

</script>

and then what would I slap in for name and stuff like that.

Thats what confuses the hell out of me.
Copy linkTweet thisAlerts:
@Paul_JrFeb 17.2004 — AHHH! After much testing and such, I believe I have found something that works.
<i>
</i>&lt;script type="text/javascript"&gt;
function refresh() {
var iframes = ["one", "two", "three"];
for(i=0; i&lt;iframes.length; i++) {
document.getElementById(iframes[i]).src = document.getElementById(iframes[i]).src;
}
}
&lt;/script&gt;
...
&lt;button onclick="refresh();"&gt;Perform Function&lt;/button&gt;
&lt;br /&gt;
&lt;iframe src="http://www.pauljunior.no-ip.com/images/melo/redblast.jpg" id="one"&gt;&lt;/iframe&gt;
&lt;iframe src="http://www.pauljunior.no-ip.com/images/melo/goldenflow.jpg" id="two"&gt;&lt;/iframe&gt;
&lt;iframe src="http://www.pauljunior.no-ip.com/images/melo/thespeedofpain.jpg" id="three"&gt;&lt;/iframe&gt;

You just have to give each iframe an ID, and put the ID's in an array -- like so.
×

Success!

Help @Cobra_Commander spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...