?
Solved

Refresh iframe content automatically

Posted on 2006-06-09
1
Medium Priority
?
546 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
shaggy_the_sheep earned 1050 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

777 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