SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    innerHTML and window.opener?

    I'm working a "print this page" button for one of my sites. When someone
    clicks the button, print.html is loaded, which is SUPPOSED to reference the
    DIV element "content_area" on the calling page and load it into print.html.

    It works locally in IE and Firefox but the minute I upload it, it ceases to
    work in IE (still works online in Firefox). Does anyone have ideas? The file is online here:
    http://www.icglink.com/tvg/e_leadNEW.html

    PRINT.HTML contains this code

    PHP Code:
    <script language="JavaScript" type="text/JavaScript">
    <!--
        var 
    theDiv=window.opener.document.getElementById("content_area").innerHTML;
        
    document.write(theDiv);
    //-->
    </script> 
    Does anyone have an idea why this might not be working? I've checked the DOM
    to make sure my reference is correct and it MUST be correct because as I
    said it works in Firefox.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  2. #2
    SitePoint Addict streetlife's Avatar
    Join Date
    Mar 2004
    Location
    D-Town
    Posts
    369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It works perfectly for me in IE6. And you are definately using the DOM to perfection. I can only assume that you are testing this on some buggy older version of IE which doesn't have this set. I think it has to be IE5+, so if you want it to be backwards compatible you'll have to query the browser type and have alternate code for older versions.

  3. #3
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh...it works now because I fixed it through another source. I'm running IE 6 by the way.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes


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
  •