PDA

View Full Version : Link between dhtml windows



joeltonnberg
08-20-2007, 09:30 AM
1) Script Title: DHTML Window widget (v1.03)

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/index.htm

3) Describe problem:

Is it possible to control properties of a window from another window, e.g. a link clicked in a window load a page in another?

ddadmin
08-20-2007, 06:04 PM
Yep, inside the first window, you'd have something like this:


<a href='javascript:parent.testwin2.load("iframe", "anotherpage.htm", "New Page Title")'>Load a Page</a>

Where testwin2 is the variable name you assigned to the second window when you opened it, and assumed to be an iframe window, something like:


var testwin2=dhtmlwindow.open("testbox", "iframe", "apage.htm", "Page Title", "width=590px,height=350px,resize=1,scrolling=1,center=1", "recal")

If the second window is of another type (ie: ajax), your link would instead be:


<a href='javascript:parent.testwin2.load("ajax", "anotherpage.htm", "New Page Title")'>Load a Page</a>