Results 1 to 2 of 2

Thread: parent.dhtmlwindow.open div not working

  1. #1
    Join Date
    Aug 2011
    Posts
    27
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default parent.dhtmlwindow.open div not working

    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:
    PHP Code:
    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??
    Last edited by antonyf; 01-14-2012 at 05:23 PM.

  2. #2
    Join Date
    Aug 2011
    Posts
    27
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •