First, make sure on your main page, that the variable you assign each DHTML window is unique:
Code:
<a href="#" onClick="ajaxwin=dhtmlwindow.open('window1', 'iframe', 'window1.html', 'window1', 'width=650px,height=200px,left=300px,top=100px,center=1,resize=0,scrolling=1'); return false">open window 1</a>
<br /><br />
<a href="#" onClick="ajaxwin2=dhtmlwindow.open('window2', 'iframe', 'window2.html', 'window2', 'width=250px,height=400px,left=300px,top=100px,center=1,resize=0,scrolling=1'); return false">open window 2</a>
I've given the second window a "ajaxwin2" name to make it unique. Secondly, to make it easier to call window1 from window 2, encase the code for window1 in a function instead, so you end up on your main page with this instead:
Code:
<script type="text/javascript">
function openwindow1(){
ajaxwin=dhtmlwindow.open('window1', 'iframe', 'window1.html', 'window1', 'width=650px,height=200px,left=300px,top=100px,center=1,resize=0,scrolling=1')
}
</script>
<a href="#" onClick="openwindow1(); return false">open window 1</a>
<br /><br />
<a href="#" onClick="ajaxwin=dhtmlwindow.open('window2', 'iframe', 'window2.html', 'window2', 'width=250px,height=400px,left=300px,top=100px,center=1,resize=0,scrolling=1'); return false">open window 2</a>
Then, on the Iframe page within window2, your link to call window1 would look like:
Code:
<a href="javascript:parent.openwindow1()">Open window 1</a>
Bookmarks