/    Sign up×
Community /Pin to ProfileBookmark

Refresh iframe?

Hello. I currently have a link generator on my page that will create a hyperlink based on the users input. Once they generate the link, and click it, it opens the webpage in an iframe.

I was wondering, is there a code out there for me to add a box next to the link that says “Refresh [ ] Times”? This way, instead of them having to click the link over and over, they can just pre-set how many times to click it and let it refresh on its own.

It is also important that there be a 300ms delay in between refreshes.

Even if you don’t know the exact code, if you can just get me started I can probably look up and figure out the rest.

Thank you in advance for any guidance you may give me.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@KDLAJul 08.2010 — Why not put a meta refresh in the HTML of the page displayed in the IFRAME, which would require nothing of the user?

Reference: http://webdesign.about.com/od/metataglibraries/a/aa080300a.htm
Copy linkTweet thisAlerts:
@ridah007authorJul 08.2010 — Thank you for your reply, I can't do that however, because I don't own/run the third party site in the iframe.
Copy linkTweet thisAlerts:
@mrhooJul 08.2010 — To force a new download of the page in the iframe, add a unique string to the tail of the url of the iframe's src attribute.

First, strip any previous tail off the src.

var url=iframe.src.replace(/?tail=[d]+/,'');

iframe.src= url+'?tail='+new Date().getTime();
×

Success!

Help @ridah007 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...