calling Perl from js, part deux

R

Richard Trahan

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?
 
T

Thomas 'PointedEars' Lahn

Richard said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top