By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,122 Members | 1,581 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,122 IT Pros & Developers. It's quick & easy.

calling Perl from js, part deux

P: n/a
I am using the following method to call a Perl script from js:
<script type="text/javascript" src="http://myserver.com/cgi-bin/x.pl?x=abc"
</script>

The Perl writes an application/x-javascript header followed by some js
code (like document.write).
This works fine (thank you, Martin Honnen). I can't use the hidden frame
method suggested by Erwin Moller because the client page is an eBay ad,
and they will not allow any frame code.

Now I want to pass to my Perl script an argument value which cannot be
known until the page is loading (specifically, the page title, which is
created by eBay and contains a unique id). I know how to get the page
title with js, but there's no way (that I can figure out) to dynamically
create the src argument of the <script> tag. Can anyone help me with
this?

Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Richard Trahan wrote:
I am using the following method to call a Perl script from js:
<script type="text/javascript"
src="http://myserver.com/cgi-bin/x.pl?x=abc" </script>
[...]
Now I want to pass to my Perl script an argument value which cannot be
known until the page is loading (specifically, the page title, which is
created by eBay and contains a unique id). I know how to get the page
title with js, but there's no way (that I can figure out) to dynamically
create the src argument of the <script> tag. Can anyone help me with
this?


Maybe loadScript() from <http://pointedears.de/scripts/dhtml.js> will help.
Distributed under the GNU GPLv2, see the DHTML constructor (more recent
nightlies have that disclaimer placed on top). Since you probably need
more than this method and the documentation overhead may be disturbing
(versions without it that include a HTML documentation file are under
construction), you are hereby allowed to remove any JSdoc comments (/**
.... */) *but* those giving attribution to the authors and contributors.
HTH

PointedEars
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.