[SOLVED] Refresh iFrame once this process has completed...

This is a discussion on "[SOLVED] Refresh iFrame once this process has completed..." within the PHP Forum section. This forum, and the thread "[SOLVED] Refresh iFrame once this process has completed... are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jan 24th, 2008, 13:16
Up'n'Coming Member
Join Date: May 2007
Location: northern nsw, au
Age: 27
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] Refresh iFrame once this process has completed...

Hi there,

I have a small problem that a good search through the web hasn't helped me.

Basically, 2 iframes. 1 iframe lists a bunch of locations in a db. You can click one of these items in the list and then in the 2nd iframe, an edit box for that location will appear. That is A-Ok. The user can then save the details and the 2nd iframe refreshes and has the newly saved details.

The problem I have is that I don't know how to make the 1st frame refresh once that process is complete. Similar to the way phpmyadmin works, when you update the tablename in the right frame, it sends a refresh over to the list of tables you have so it displays the saved data. How do I do that?

The best solution I've found is a <meta> refresh every few seconds... but as you can imagine that is wasteful and not as effective as just refreshing the frame once its finished the process.

I did come across the javascript but these didn't work:
Code: Select all
<script type="text/javascript">
frames['lister'].location.href = frames['lister'].location.href;
frames['lister'].reload(true);
</script>
Any help on this would be really helpful.

Thanks anybody in advance.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jan 24th, 2008, 16:54
JustinStudios's Avatar
Reputable Member
Join Date: Mar 2007
Location: USA
Posts: 404
Blog Entries: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Refresh iFrame once this process has completed...

I've seen people do this and the most common solution is to just reload the page that holds the iframes. Seems to work fine for most things. Another thing you could do, is set a link to the iframe target to the same page, which refreshes it as well. Although i'm not really a fan of this.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jan 25th, 2008, 00:11
Up'n'Coming Member
Join Date: May 2007
Location: northern nsw, au
Age: 27
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Refresh iFrame once this process has completed...

Thanks for that Justin.

I am aware I could do these things you suggested but I am moving this page to more of a dynamic application. e.g ajax like
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jan 25th, 2008, 01:11
Up'n'Coming Member
Join Date: May 2007
Location: northern nsw, au
Age: 27
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Refresh iFrame once this process has completed...

Something like this php(if it were possible somehow) would be great...
Code: Select all
header("Location: page.php", '1stframe');
But I know there isn't a target part in the header function...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jan 25th, 2008, 01:52
Up'n'Coming Member
Join Date: May 2007
Location: northern nsw, au
Age: 27
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Refresh iFrame once this process has completed...

Problem solved with
Code: Select all
<script type="text/javascript">
window.parent.lister.location.reload()
</script>
'lister' being the id of the iframe I was wanting to reload.

Last edited by cosmicbdog; Jan 25th, 2008 at 01:53. Reason: minor improwvement
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jan 25th, 2008, 03:32
JustinStudios's Avatar
Reputable Member
Join Date: Mar 2007
Location: USA
Posts: 404
Blog Entries: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Refresh iFrame once this process has completed...

Glad you got it fixed. I personally don't like using Javascript for mainline things (such as reloads) as it can be disabled. If this program is used in a closed environment it shouldn't be an issue though.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Jan 25th, 2008, 03:38
Up'n'Coming Member
Join Date: May 2007
Location: northern nsw, au
Age: 27
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Re: [SOLVED] Refresh iFrame once this process has completed...

I tend to agree. This is a closed environment like you say though, and up until now, we've been happy with having the whole page load in one scoop using includes etc. The problem has been that the application has grown, the database multiplied and we have users sometimes updating the db for 1000 records. Waiting for just a snippet of the page to load each time compared to the whole thing is going to mean the difference between 5-6 seconds load time each record update to 2-3 seconds which starts to add up.

Do you know if there is a way to achieve the above though without using JS? Javascript is a bit alien to me as I mostly work with PHP but I am starting to lose my competitive edge with this AJAX stuff.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to stop the browser refresh on clicking the webbrowser's refresh button ? camarun20 JavaScript Forum 3 Mar 18th, 2008 23:04
[SOLVED] refresh a different iframe once an iframe elsewhere has loaded cosmicbdog JavaScript Forum 1 Jan 25th, 2008 01:50
My javascript for multiple choice questions (COMPLETED) RohanShenoy Webforumz Cafe 0 Dec 4th, 2007 07:52
Can a jsp file in an IFrame calls a javascript function outside of the IFrame jadeite100 JavaScript Forum 0 May 31st, 2007 14:29
Flash Job To Be Completed nb Job Opportunities 1 May 18th, 2005 20:17


All times are GMT. The time now is 21:28.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42