[thelist] JS and CGI
Jeremy Ashcraft
ashcraft at 13monkeys.com
Thu, 06 Jan 2000 22:32:58 -0600
--------------B7A6385461CE7C2633C3DE09
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
>
> > > Greetings List,
> > >
> > > Am delving into some cgi stuff at present and was wondering if it was possible to use a JS
> > > function like :
> > > <script language="javascript>open.window('foo.htm','new',config='width=500,
> > > height=400')</script>...but replace foo.htm with a sub routine.
> >
You might try window.open instead of open.window, also I take it you want to have the contents returned from &admin show up in the new window, try something like this:
<perl script snippet>
...
print "<script language="javascript>\n";
print "var newWin = window.open('','new','width=500, height=400');\n";
$output = &admin;
print "newWin.document.open();\n";
print "newWin.document.write('$output');\n";
print "newWin.document.close();\n";
print "<script>\n";
...
</perl script snippet>
what the above does is print out the javascript that opens a new empty window with no file specified. It then calls &admin and &admin returns some type of text or something to the variable $output. It then
print the javascript to open the document in the new window, print the contents of $output into the new window, then close the document. LMK if you have any questions.
--
Jeremy Ashcraft
web developer/geek
http://www.13monkeys.com
--------------B7A6385461CE7C2633C3DE09
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<blockquote TYPE=CITE>
<br>> > Greetings List,
<br>> >
<br>> > Am delving into some cgi stuff at present and was wondering
if it was possible to use a JS
<br>> > function like :
<br>> > <script language="javascript>open.window('foo.htm','new',config='width=500,
<br>> > height=400')</script>...but replace foo.htm with a sub
routine.
<br>></blockquote>
<p><br>You might try window.open instead of open.window, also I take
it you want to have the contents returned from &admin show up in the
new window, try something like this:
<p><perl script snippet>
<br>...
<br>print "<script language="javascript>\n";
<br>print "var newWin = window.open('','new','width=500, height=400');\n";
<p>$output = &admin;
<p>print "newWin.document.open();\n";
<br>print "newWin.document.write('$output');\n";
<br>print "newWin.document.close();\n";
<br>print "<script>\n";
<br>...
<br></perl script snippet>
<p>what the above does is print out the javascript that opens a new empty
window with no file specified. It then calls &admin and &admin
returns some type of text or something to the variable $output.
It then print the javascript to open the document in the new window, print
the contents of $output into the new window, then close the document.
LMK if you have any questions.
<pre>--
Jeremy Ashcraft
web developer/geek
<A HREF="http://www.13monkeys.com">http://www.13monkeys.com</A></pre>
</html>
--------------B7A6385461CE7C2633C3DE09--