PDA

View Full Version : parent.dhtmlwindow.open div not working



antonyf
01-14-2012, 05:09 PM
1) Script Title: DHTML Window widget (v1.1)

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

3) Describe problem: Hi. I am loading the dhtmlwindow script from a link on a page inside an iframe. Im using the div option. The div to load is also on the same page inside the iframe. I use the parent.dhtmlwindow.open.... The window opens fine, but the div doesn't load. I just get a blank page.

I use this script to load the dhtmlwindow:


echo '<div style="position:absolute;top:0px; left:0px; width:102px; height:11px;background-color:transparent; color:#aaaaaa">
<!-- START CHAT CODE -->
<div id="div_online"></div>
<script type="text/javascript">
var new_window = false;

var url_destination = \'http://'.$host.'/chat/'.$username.'/'.$profemail2.'/\';

var url_ajax = \'http://'.$host.'/chat/'.$username.'/'.$profemail2.'/\';

var texto_online = "<a href=\"javascript:void(0);\" onClick=\"parent.dhtmlwindow.open(\''.$username.'box\', \'div\', \''.$profemail2.'divider\', \''.$profname.'\', \'width=224px,height=237px,left=200px,top=150px,resize=0,scrolling=0,center=1\'); return false\"><font style=\"padding-left:0px; width:100%; background-color:transparent;color:#000000; font-size:11px; text-decoration:none; text-align:left\">CHAT ONLINE</font></a>";

var texto_offline = \'<span style=\"padding-left:0px; width:100%; background-color:transparent; color:#ff0033; font-size:11px; text-decoration:none; text-align:left\">CHAT OFFLINE</span>\';

document.write(\'<\' + \'script type="text/javascript" src="http://'.$host.'/chat/'.$username.'/'.$profemail2.'/chat.js"></\' + \'script>\');
</script>
<div id="'.$profemail2.'divider" name="'.$profemail2.'divider" style="display: none;">
<div style="background-color:transparent;">
<iframe style="width:224px; height:237px;" src="http://'.$host.'/chat/'.$username.'/'.$profemail2.'/chatwindow.html" marginwidth="0" marginheight="0" hspace="0" vspace="0" border="0" frameborder="0" allowtransparency="true" scrolling="no"></iframe>
</div>
</div>
</div>
</body>
</html>';


Notes:
-The page is a .php page.
- All the links work meaning they are all correct.

Should the div be on the parent page? i did try this but maybe i should pursue it??

antonyf
01-15-2012, 08:35 AM
I solved it.

i put the div on the parent page. and opened it from the page inside the iframe. This is interesting too cause you can open any parent page content in the iframe page.

I didnt change any code just shifted the div as is to the parent page, if it helps someone.