Solved

reloading content in an iframe from jquery

Posted on 2010-11-24
5
510 Views
Last Modified: 2012-05-10
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
Comment
Question by:cgray1223
  • 4
5 Comments
 
LVL 44

Expert Comment

by:scrathcyboy
ID: 34209529
sure --

window.iframename.reload
0
 
LVL 44

Expert Comment

by:scrathcyboy
ID: 34209537
or document.iframename.reload.

You can also reload the link -- <A href="video.file" target="iframename">
0
 
LVL 44

Expert Comment

by:scrathcyboy
ID: 34209542
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
 

Author Comment

by:cgray1223
ID: 34209646
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
 
LVL 44

Accepted Solution

by:
scrathcyboy earned 500 total points
ID: 34209820
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now