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.

Refresh iframe and not the page

3 posters

Go down

Solved Refresh iframe and not the page

Post by BL@DE April 8th 2015, 8: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.
avatar
BL@DE
Forumember

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

Back to top Go down

Solved Re: Refresh iframe and not the page

Post by Ange Tuteur 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
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Refresh iframe and not the page

Post by BL@DE 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 ?
avatar
BL@DE
Forumember

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

Back to top Go down

Solved Re: Refresh iframe and not the page

Post by Ange Tuteur 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
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Refresh iframe and not the page

Post by BL@DE 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 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();" />
avatar
BL@DE
Forumember

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

Back to top Go down

Solved Re: Refresh iframe and not the page

Post by Ange Tuteur 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
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Refresh iframe and not the page

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

ok mate thanks very much for your help Smile this topic is done.
avatar
BL@DE
Forumember

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

Back to top Go down

Solved Re: Refresh iframe and not the page

Post by SLGray April 11th 2015, 11: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.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51464
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top

- Similar topics

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