PERL/JavaScript?

Is there a way to incorporate JavaScript, and PERL together on the same webpage? I tried doing the print>>EndofHtml
...and including Javascript in the html output, but it didn't seem to work.
Any help will be greatly appreciated.
Thanks!!
--------------booleanBill
booleanBillAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ozoConnect With a Mentor Commented:
It might help to know that the or something was.
but one possibility could be that there was extra blank space around the
EndofHtml
at the end, which kept it from matching the <<EndofHtml; at the beginning.

if $image is a perl variable, then
print<<EndofHtml;
<script language="javascript">
img1.src = $image;
</script>  
EndofHtml
will insert interpolate into the javascript code
0
 
ozoCommented:
Assuming you meant print<<EndofHtml
what didn't work?
0
 
booleanBillAuthor Commented:
Opps! Yeah, I meant print<<EndOfHtml
Well for some reason, whenever I include (") quotes in my html output, it gets screwy. I have to do all my <font size=3> asignments without "'s .
But of course you can't do that with JavaScript.
0
Will You Be GDPR Compliant by 5/28/2018?

GDPR? That's a regulation for the European Union. But, if you collect data from customers or employees within the EU, then you need to know about GDPR and make sure your organization is compliant by May 2018. Check out our preparation checklist to make sure you're on track today!

 
ozoCommented:
Can you give an example of a (") that gets screwy?
Depending on the context, you may have wanted to use \" or &quot;
0
 
booleanBillAuthor Commented:
Lets say I want to create a table to store the data in from a survey, so for instance:
#!usr/local/bin/perl

print "Content-type:text/html\n\n";

open(FROMFILE,"<guestdata.txt");

print<<EndofHtml;
<html><head><title>Survey results</title>
<script language="javascript">
<!--
some code
//-->
</script>
</head>
<body text="color" ect.....>
 see these quotes^ that's what I mean.
<table>
<tr>
<td>
EndofHtml
;
while(<FROMFILE>){
   print;
}

print<<EndofFoot;
</td></tr></table>
ect........


0
 
booleanBillAuthor Commented:
One more thing, I have seem other code that includes quotes, and it seems to work for them. I can't fugure it out. Must be something I'm doing.?????
0
 
ozoCommented:
Those quotes seem fine.  What problem are you having with them?
0
 
booleanBillAuthor Commented:
Well it just won't work, it says unterminated string constant ,or compilation error, or something!
I'm not even sure if it IS the quotes. But when I last had the problem I just took out the quotes and it worked again. But now, I can't do that, cause I need some JavaScript in there.
I also was wondering if there is a way to do this: (which is kinda what I really meant)
var img1 = new Image();
img1.src = $image;

I know THAT won't work. but you see what I mean , using a value from a perl program directly in a JavaScript. Or the other way around.
Is there a way to do that?

ps- I'd like to go ahead and give you the points. You've been so helpful.
0
 
booleanBillAuthor Commented:
Thanks ozo!! I'm sorry if I was a bit vague. I'm very new to the JavaScript, and PERL world. Acually I don't even know much about programming in general.
I just read articles, and tutorials online and attempt to do it myself, which has been pretty successful considering (i'm inexperienced), You can visit some of my attempts if you'd like
http://jodellah.virtualave.net/kellycode/

Thanks!!
0
All Courses

From novice to tech pro — start learning today.