Results 1 to 4 of 4

Thread: iframe problem

  1. #1
    Join Date
    Oct 2011
    Location
    London
    Posts
    41
    Thanks
    19
    Thanked 1 Time in 1 Post

    Exclamation iframe problem

    hi guys i have benn trying to solve this problem but cant i have a Jcow site twitterrooms.co.uk which has a mobile site /mobile now i put
    PHP Code:
    <meta name="apple-mobile-web-app-capable" content="yes">
    <
    meta name="apple-mobile-web-app-status-bar-style" content="black"
    in the header and what this does is hides the top url bar and bottom menu bar WORKS GREAT except when a link is clicked it reloads the page and brings back the url & menu bar

    I tried this
    PHP Code:
    <iframe style="width:100%;height:100%" src="http://twitterrooms.co.uk/mobile">
      <
    p>Your browser does not support iframes.</p>
    </
    iframe
    but it still reloads the page how can i stop this and make the iframe reloadable but the page dont ??? if this makes sence

    PLEASE HELP

  2. #2
    Join Date
    Oct 2008
    Posts
    60
    Thanks
    2
    Thanked 7 Times in 7 Posts

    Default

    1) This is not a PHP problem, next time post in the correct section.

    You have to achieve this from Javascript:

    Code:
    <script type="javascript/text">
    function reloadIt()
    {
    frm=document.getElementsByName("twitter")[0];//we get the iframe object
    frm.src=frm.src;//or you can set the src to a new src.
    setTimeout("reloadIt()",60000);//the function will run every 60000 miliseconds, or 60 seconds
    }
    </script>
    
    <body onload="reloadIt()"> 
    <iframe id="twitter" style="width:100%;height:100%" src="http://twitterrooms.co.uk/mobile">
        <p>Your browser does not support iframes.</p> 
    </iframe>

  3. #3
    Join Date
    Oct 2011
    Location
    London
    Posts
    41
    Thanks
    19
    Thanked 1 Time in 1 Post

    Default

    thanks but this is not what i wanted this only reloads the page every 60sec i want the iframe to reload but NOT the main page

  4. #4
    Join Date
    Oct 2008
    Posts
    60
    Thanks
    2
    Thanked 7 Times in 7 Posts

    Default

    Try this. it works for me in IE

    <script>
    function reloadIt()
    {
    frm=document.getElementById('twitter').src;
    document.getElementById('twitter').src = frm;
    setTimeout("reloadIt()",10000);
    }

    </script>
    </head>
    <body onload="reloadIt()">
    <iframe id="twitter" style="width:100%;height:500px" src="http://www.google.com">
    <p>Your browser does not support iframes.</p>
    </iframe>

Bookmarks

Posting Permissions

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