Skip to content

JavaScript window extension

In addition to the "exeoutput" JavaScript object available in ExeOutput apps, ExeOutput for PHP extends the window object, especially to deal with secondary windows or pop-ups.

Tip

The following samples can be tested in the Secondary Windows and Popups topic of the General Demonstration.

The following commands are available:

window.open

window.open() is completely supported. You can also give names to your pop-ups and then identify them or manipulate them with JavaScript.

For instance:

<script>
  $(function() {

    $("#btn").click( function()
    {
        window.open('samples/testpopup.php', 'Popup');
    }
 }
</script>

window.exportPDF

window.exportPDF(pdffilename) is a JavaScript extension available in ExeOutput apps. This lets you export the content of the window as a PDF file.

pdffilename lets you pass the full path and filename of the PDF file to be exported.

For instance:

<script language="javascript">
   // Callback for save dialog box - content contains the full path to the future PDF file.

    function DemoSavePDF(content) {
            if (content === "") return;
            window.exportPDF(content);
        }

    function exportpdf() {
        // Run HEScript script SavePDFDlgFile defined in UserMain to get the PDF filename.
        exeoutput.GetHEScriptCom('hescript://UserMain.SavePDFDlgFile', DemoSavePDF);
        }

</script>

window.moveTo and window.resizeTo

window.moveTo() and window.resizeTo() are supported too.

Here is an example to display a fullscreen window:

 function showmaxpop()
      {
      var w = window.open('about:blank', 'Report', "fullscreen");
      w.document.open();
      w.document.write('Hello large popup');
      w.document.close();
      w.moveTo(0,0);
      w.resizeTo(screen.availWidth, screen.availHeight);
      }

See these topics also:

The JavaScript exeoutput object

How to call HEScript procedures/functions in JavaScript?