Link to home
Start Free TrialLog in
Avatar of KeithMcElroy
KeithMcElroy

asked on

populate a pop up div from the opener

I have not been able to get the h variable to be populated into the div tag on the pop up

/*
print-functions.js

WORK LOG
Date    Name      Item(s)      Comments
8/22/2012  keith    code review    WARN:  needs refinement,

*/
function closePrint()
{
      
      $('#print-region').hide()
      $('#print-region').html("")
      
}

function printVersion()
{
      h = $('#sectionA').html()
      h += $('#sectionB').html()
      h += $('#sectionC').html()
      h += $('#sectionD').html()
      h += $('#sectionE').html()
      h += $('#sectionF').html()
      h += $('#sectionG').html()
      h += $('#sectionH').html()
      h += $('#sectionI').html()
      h += $('#sectionJ').html()

      var popup = window.open( "HRPANFRM/popup/print.html", "", "status = 1, width=400,height=200,toolbar=yes, location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes, resizable=yes" )


//populate h into  the printarea div in the popup
      
}


//:popup file  print.html
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.min.js"         type="text/javascript"></script>
<script src="../jq/print-element.js" type="text/javascript"></script>                              <!--jquery library-->
<SCRIPT LANGUAGE=javascript>
<!--
function printthis()
{
$('#printarea').printElement()
}

      
      
      
//-->
</SCRIPT>

</head>
<body>
<div id="printarea">

print area  
</div>
<a href='javascript:printthis()'>Print</a>
</body>
</html>
Avatar of djon2003
djon2003
Flag of Canada image

after your comment for h insertion :
popup.document.getElementById('printarea').innerHTML = h;

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial