in reply to embedding a <script> tag in an html doc to call remote perl

It depends on what you're trying to do :) The example code fragment isn't standard HTML, so it needs server-side support...it literally is never sent to the web browser. Further commentary assumes you want to do it in HTML.

This won't work with normal web browsers because they don't contain Perl interpreters:

<script language=Perl src="/cgi-bin/WonderScript.pl"></script>

If the web browser has JavaScript enabled: this will work, if the Perl script returns a JavaScript document:

<script language=JavaScript src="/cgi-bin/WonderScript.pl"></script>

And this probably will work, if the Perl script returns HTML:

<iframe src="/cgi-bin/WonderScript.pl"> <ilayer src="/cgi-bin/WonderScript.pl"> </iframe>

Of course, the last probably will require more HTML tags to make the thing format properly. The iframe handles W3C browsers (e.g., Internet Explorer 4+ and Netscape 6), while the ilayer handles Netscape 4.

Replies are listed 'Best First'.
Re: Re: embedding a <script> tag in an html doc to call remote perl
by mkahn (Beadle) on Jul 16, 2002 at 19:19 UTC
    Thank you both, C & Z.

    I want to let developers to embed my content in their page simply, and transparently.

    It's not my hosting environment, so activestate is out.

    The iframe solution works, but I don't want it in a different frame; no transparency. The solution I'm inferring is to write the script to output in javascript.

    I'm combing around now for a module. Unless I (findmodule), I'll have to read(lots of stuff about cross-browser compatability) and write (several different versions based on the browser ID) I (imagine).