Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help Embedding Javascript Code in a PERL Script? 1

Status
Not open for further replies.

mojodaddy

Programmer
Aug 23, 2006
2
US
Dear All,

I'm a seasoned web designer, but when it comes to PERL programming my skills are extremely limited. I apologize for any annoyance my newbie question may generate, but I see you as respected experts who may be able to help me.

Here's my situation: I'm trying to embed Javascript code into a PERL coded template that's used to display events through a Perl calendar script. I'm able to add the code, but the copde, which is supposed to call in a banner ad pool from a remote server, generates no result. I can see it when I view by source.

I've snipped and commented the code in question at:


Can anybody out there lend a hand?

Best,

Pat
MilwaukeeMoms.com
 
Code:
<!-- Start Ads Pro Code -->
<p align="center">
<SCRIPT SRC=[URL unfurl="true"]http://www.milwaukeemoms.com/cgi-bin/adspro/ads.pl?campaign=18&type=java></SCRIPT>[/URL]
</p>
<!-- Stop Ads Pro Code -->

Just make sure the perl script outputs
Code:
Content-Type: text/javascript\n\n
as its first output, apart from that it seems fine

HTH

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Dear Paul,

Thanks for the help! One more question:

Does the Content-Type: text/javascript\n\n go in the head section of the document or somewhere else?

Peace,

Pat
 
the first thing that should be output by that perl script
should be
Code:
#!/usr/bin/perl
use CGI;
$q=new CGI;
print $q->header(type=>'text/javascript');
...
could be a little rusty on the CGI, but you'll find it in the documentation assuming the CGI module, or simply
Code:
#!/usr/bin/perl
print "Content-Type: text/javascript\n\n";
...

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top