PDA

View Full Version : opening dhtmlwindow in parent from iframe



ibhayat
04-08-2008, 06:08 PM
1) Script Title: dhtmlwindow.js

2) Script URL (on DD): www.dynamicdrive.com

3) Describe problem:



I am trying to open a floating window in the parent from iframe.

here is the code.

here is the main page...

<?php

echo "Testing....";

echo '
<iframe name="mainwin" src ="http://www.mysalah.com/notice_master.php?id=ist"
marginwidth=-50 marginheight=0 frameborder=0 width=167 height=312 scrolling="no" align="middle">
</iframe>

';


?>


here is notice_master.php

<script type="text/javascript">
var googlewin=dhtmlwindow.open("googlebox", "iframe", "http://mysalah.com/notice.php?id=$mosque", "mysalah", "width=700px,height=450px,resize=1,scrolling=1,center=1")
</script>


The floating window opens in IFRAME. How do i open it in the main window.


Thanks,

ismail

ddadmin
04-09-2008, 08:52 PM
First, make sure DHTML window script is installed on your main page (contained in the main window). Then, inside the IFRAME page, to get a DHTML window to open on the main page, you'd modify your default code with something like:


var googlewin=parent.dhtmlwindow.open("googlebox", "iframe", "http://mysalah.com/notice.php?id=$mosque", "mysalah", "width=700px,height=450px,resize=1,scrolling=1,center=1")

There are a few threads on this already actually, try doing a search.