Solved

Refresh iframe content automatically

Posted on 2006-06-09
1
540 Views
Last Modified: 2008-03-06
I have an iframe which i want to refresh every 2 seconds.

lets say

<iframe src="http://www.yahoo.com">
</iframe>

i wanna load only the iframe. now i dont have control on the other url (src)

I dont know how meta refresh will work.
0
Comment
Question by:tgatif
1 Comment
 
LVL 5

Accepted Solution

by:
shaggy_the_sheep earned 350 total points
ID: 16871454
Hi

You could use a JavaScript function to re-enter the src of the iframe, thus reloading it.

var timer; function reloadFrame(){

document.getElementById('myFrame').src = 'http://www.yahoo.com';

clearTimeout(timer)
timer = setTimeout('reloadFrame()',2000)
}

now change your iFrame to this:
<iframe id="myFrame" src="http://www.yahoo.com">
</iframe>

And call the function onload
<body onload="reloadFrame()">

Let me know if this works okay

Richard
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Poster Video HTML 5 Scale to fit video 3 38
File download script VBSCRIPT fail on download PPT files 2 37
Apply tab index in forms 6 36
Centered Image 2 23
This article discusses four methods for overlaying images in a container on a web page
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now