faqts : Computers : Programming : Languages : JavaScript : Frames

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

21 of 31 people (68%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

How do I write a recursive version of history.go() that will iterate the child frames of each window?

Aug 29th, 2000 07:29
Martin Honnen, Chris Durkin,


function historyGoForLeafFrames (n, frame) {
  if (!frame)
    frame = window;
  if (frame.frames.length == 0) 
    frame.history.go(n);
  else for (var f = 0; f < frame.frames.length; f++)
    historyGoForLeafFrames(n, frame.frames[f]);
}
Call for example as
  historyGoForLeafFrames(0)
to reload all leaf frames