www.webdeveloper.com
Results 1 to 2 of 2

Thread: Auto refresh webpage in a iframe with redirect page

  1. #1
    Join Date
    Apr 2013
    Posts
    2

    Unhappy Auto refresh webpage in a iframe with redirect page

    Hi, the picture is a sample page include one iframe and one button.
    The iframe has load a default web page 1. What I want to do is when someone click on the button, the page which in iframe can be redirect to another fixed page and auto refresh by any 5 seconds.
    canvas.jpg
    I got these code now, but can only refresh page by one click...

    HTML
    <!--Button-->
    <button onclick="refreshIframe();">Refresh Iframe</button>
    <!--iframe-->
    <iframe name="Iframe" src="http://www.google.com/" target="_blank">

    Javascript part
    Code:
    function refreshIframe() {
        var ifr = document.getElementsByName('Iframe')[0];
        ifr.src = ifr.src;
    }
    Anyone helppppppppppp

  2. #2
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,351
    Please do not double post.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles