This is more java JavaScript related than perl, but i have a page where i want to execute java JavaScript when it loads. based on what it does so you could try

print $q->header( -type =>'text/html'); print <<"EODEOD"; <title>mytitle</title> <script language="JavaScript"> <!-- function iframeLoad(a) { window.parent.postMessage({ 'func': 'GetFileLoadStatus', 'message': 'Message text from iframe.' }, "*"); } //--> </script> <body onload="iframeLoad()"> EODEOD

Edit: a was just a temp var, my sub was

function iframeLoad(a) { a = document.getElementById("tableId").innerHTML; parent.document.getElementById("tableId").innerHTML = a; parent.document.getElementById("hiframe").src = "about:blank"; }
In the parent i had
... function showTable(loc) { document.getElementById("tableId").innerHTML="Waiting on:" + loc; document.getElementById("hiframe").src = loc; } ... <input type="button" value="run program" onclick="showTable('/cgi-bin/ +program.pl?parm1=1')"> <iframe id="hiframe" src="about:blank" style="visibility:hidden;displa +y:none"></iframe> <div id="tableId" style="background-color:lightgray"></div> ....
and the cgi call also returned
.... <div id="tableId"> <pre> some stuff to display more stuff </pre></div>


In reply to Re^3: send windowmessage from cgi back to form that called the cgi by huck
in thread send windowmessage from cgi back to form that called the cgi by tultalk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.