Refresh iframe and not the page Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.
3 posters

    Refresh iframe and not the page

    avatar
    BL@DE
    Forumember


    Male Posts : 161
    Reputation : 10
    Language : English
    Location : England

    Solved Refresh iframe and not the page

    Post by BL@DE Wed Apr 08, 2015 7:56 pm

    Hello all.

    right I need some help. I want to put some think in my iframe and I want to put a button under it to so if I press it it will refresh the iframe and not the page. how can I do this ? and can this be done in HTML ?

    Thanks BL@DE.
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Refresh iframe and not the page

    Post by Ange Tuteur Wed Apr 08, 2015 11:15 pm

    On the page where your iframe is, add a button like this :
    Code:
    <input type="button" value="refresh" onclick="window.location.reload();" />

    Or just add a link with the same location.

    Also note that you can just right click on the iframe > This frame > Reload frame
    avatar
    BL@DE
    Forumember


    Male Posts : 161
    Reputation : 10
    Language : English
    Location : England

    Solved Re: Refresh iframe and not the page

    Post by BL@DE Thu Apr 09, 2015 9:36 pm

    hey thanks for get in back to me. thanks for the button. how can I do a iframe now what is the code to do it ?
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Refresh iframe and not the page

    Post by Ange Tuteur Thu Apr 09, 2015 10:58 pm

    This is the syntax :
    Code:
    <iframe src="PAGE_URL"></iframe>

    PAGE_URL : The URL of the page you want to display.

    You can adjust the border and size by adding the style attribute.
    Code:
    style="width:350px;height:250px;border:none"
    avatar
    BL@DE
    Forumember


    Male Posts : 161
    Reputation : 10
    Language : English
    Location : England

    Solved Re: Refresh iframe and not the page

    Post by BL@DE Thu Apr 09, 2015 11:21 pm

    Hello mate. right I have them all now. were do I put this code to get it work in ?


    Code:
    style="width:350px;height:250px;border:none"

    and how do I get this button work in. I am new to this code in stuff. it is very hard.

    Code:
    <input type="button" value="Refresh" onclick="window.location.reload();" />
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Refresh iframe and not the page

    Post by Ange Tuteur Thu Apr 09, 2015 11:50 pm

    Like this :
    Code:
    <iframe src="PAGE_URL" style="width:350px;height:250px;border:none"></iframe>

    For the button, you'd need to have access to the contents of the linked page to add it in, because you cannot have JavaScript in posts. If it's being added in an HTML page or widget, then you can do this :
    Code:
    <iframe id="myFrame" src="http://help.forumotion.com/" style="width:350px;height:250px;border:none"></iframe>
    <input type="button" value="refresh" onclick="document.getElementById('myFrame').src = document.getElementById('myFrame').src;"/>
    avatar
    BL@DE
    Forumember


    Male Posts : 161
    Reputation : 10
    Language : English
    Location : England

    Solved Re: Refresh iframe and not the page

    Post by BL@DE Sat Apr 11, 2015 9:34 pm

    ok mate thanks very much for your help Smile this topic is done.
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    Solved Re: Refresh iframe and not the page

    Post by SLGray Sat Apr 11, 2015 10:03 pm

    Topic solved and archived



    Refresh iframe and not the page Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.