Topic: trying to reload iframe from other iframe (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=30892" title="Pages that link to Topic: trying to reload iframe from other iframe (Page 1 of 1)" rel="nofollow" >Topic: trying to reload iframe from other iframe <span class="small">(Page 1 of 1)</span>\

 
nakins
Obsessive-Compulsive (I) Inmate

From:
Insane since: Mar 2006

posted posted 03-03-2009 17:59

I'm trying to reload a page in an iframe (a content page) from a page in another iframe (hidden, that checks for updates). The parent for both of these iframes is the main window. I'm trying to do this with javascript. The following is the source code that loads into iframe fr1, which is trying to reload iframe fr2.

code:
function updateWindow() {
window.frames[fr2].location = url;
} 
window.onload = updateWindow;



But this doesn't seem to be working. What am I doing wrong here?

Kyle the Feared
Obsessive-Compulsive (I) Inmate

From:
Insane since: Jan 2009

posted posted 03-04-2009 06:18

If that code is loaded in the first frame, then window.frames is a reference to the first frame's frames (I assume it has none).
To get the frames of the main window, you will need to use parent.frames.
And if you had multiple levels of frames, you could get to the main by using top.frames.

Also, I'm assuming fr2 is a global variable defined in the top frame?
If so, then you will need to reference it as parent.fr2 or top.fr2.

This may help you.
http://www.oreillynet.com/pub/a/javascript/excerpt/jstdg_ch13/index.html?page=7#multwinfram

(Edited by Kyle the Feared on 03-04-2009 06:19)

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

posted posted 03-04-2009 12:15

Beside, I'm wondering what's the use case for frames & iframes these days beside sandboxing web widgets and ads. Since you already require JavaScript to be enabled, surely you XHR chunks of information and dynamically update parts of the of page. After all it's the 21st century and all.

yossiadmon
Obsessive-Compulsive (I) Inmate

From: Israel
Insane since: Sep 2009

posted posted 09-07-2009 18:28

Just give the frame / iframe a name and submit a form with target="frame name" it will work regardless to the frame level
(I won't ask why using frames...)

parker
Obsessive-Compulsive (I) Inmate

From:
Insane since: Oct 2010

posted posted 10-18-2010 13:56

Nice walk through DarkGarden. Adding noise was a great insight, I'd missed that step in my thoughts on how the technique would go. I also thought that running the wind filter in the opposite direction would smudge the effects from the first pass of wind ~couldn't resist~
I do think that the overall effect can be enhanced by a little hands on Liquefy.

parker
Obsessive-Compulsive (I) Inmate

From:
Insane since: Oct 2010

posted posted 10-18-2010 13:58

he parent for both of these iframes is the main window. I'm trying to do this with javascript. The following is the source code that loads into iframe fr1, which is trying to reload iframe fr2.

(Edited by parker on 10-18-2010 13:59)

coach
Nervous Wreck (II) Inmate

From:
Insane since: May 2011

posted posted 05-31-2011 10:59
Edit TP: spam removed


Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu