• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 544
  • Last Modified:

reloading content in an iframe from jquery

Hello,

I have two pages the main page and the iframe page (video.php).  I would like to refresh only the iframe page from link on the main page without refreshing the main page.  Is that possible?

main page housing the iframe:
<div id="tabs-5">
    <div id="container5" class="demo ui-widget ui-helper-clearfix" style="background- color:#FFEEFF;width:1100px;">
         <iframe width="1100px;" height="500;" align="left" frameborder="0" src="/youtube/video.php"></iframe>
    </div>
</div>

Open in new window

0
cgray1223
Asked:
cgray1223
  • 4
1 Solution
 
scrathcyboyCommented:
sure --

window.iframename.reload
0
 
scrathcyboyCommented:
or document.iframename.reload.

You can also reload the link -- <A href="video.file" target="iframename">
0
 
scrathcyboyCommented:
oops, I see you have not NAMED your iframe.  It MUST have a name = iframename parameter, and you address that directly -- if you address the DIV nothing will happen, because DIVs do not control iframes and really should not enclose them, except for positioning.
0
 
cgray1223Author Commented:
Thanks for the suggestion.  For some reason I had to use the below.  The suggestion you gave me threw a JS error saying that property wasn't supported by the object.  I thought the code below and what you suggested is basically the same thing, right?

window.frames["frameName"].location.reload();      
0
 
scrathcyboyCommented:
yes -- in some cases you have to tell it it is part of the Frames object, sorry I should have mentioned that, but yes, it is the same code addressing the same iframe.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now