Solved

Refresh iframe content automatically

Posted on 2006-06-09
1
539 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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

771 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

7 Experts available now in Live!

Get 1:1 Help Now