The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Refresh iframe and not the page

View previous topic View next topic Go down

Solved Refresh iframe and not the page

Post by BL@DE on April 8th 2015, 8:56 pm

Hello all.

right I need some help. I want to put some think in myiframe 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.

BL@DE
Forumember

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

Back to top Go down

Solved Re: Refresh iframe and not the page

Post by Ange Tuteur on April 9th 2015, 12:15 am

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

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Refresh iframe and not the page

Post by BL@DE on April 9th 2015, 10: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 ?

BL@DE
Forumember

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

Back to top Go down

Solved Re: Refresh iframe and not the page

Post by Ange Tuteur on April 9th 2015, 11: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"

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Refresh iframe and not the page

Post by BL@DE on April 10th 2015, 12:21 am

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 getthis 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();" />

BL@DE
Forumember

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

Back to top Go down

Solved Re: Refresh iframe and not the page

Post by Ange Tuteur on April 10th 2015, 12:50 am

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;"/>

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Refresh iframe and not the page

Post by BL@DE on April 11th 2015, 10:34 pm

ok mate thanks very much for your help Smilethis topic is done.

BL@DE
Forumember

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

Back to top Go down

Solved Re: Refresh iframe and not the page

Post by SLGray on April 11th 2015, 11:03 pm

Topic solved and archived


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


SLGray
Administrator
Administrator

Male Posts : 36641
Reputation : 2443
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum