Solved

Refresh iframe content automatically

Posted on 2006-06-09
1
544 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 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

729 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