Connecting Tech Pros Worldwide Help | Site Map

About Javascript in perl

Member
 
Join Date: Sep 2007
Posts: 121
#1: Mar 23 '09
Hi friends,
I have one small doubt that we can write the html code in perl program as saying by content-type: text/html but when i write javascript code that is printing on the browser not as javascript functionality.

My main doubt is how can we write javascript code in perl program?
KevinADC's Avatar
Expert
 
Join Date: Jan 2007
Location: Southern California USA
Posts: 4,091
#2: Mar 23 '09

re: About Javascript in perl


Quote:

Originally Posted by sasimca007 View Post

Hi friends,
I have one small doubt that we can write the html code in perl program as saying by content-type: text/html but when i write javascript code that is printing on the browser not as javascript functionality.

My main doubt is how can we write javascript code in perl program?

javascript is just text that perl outputs to a browser, so you just wrap it in the correct http headers and html tags and it will work when loaded in a web browser. Its impossible to say what you might have done wrong without seeing what you have tried.
Icecrack's Avatar
Expert
 
Join Date: Sep 2008
Location: Sydney, Australia
Posts: 173
#3: Mar 24 '09

re: About Javascript in perl


Post the code that your trying to work with and as Kevin Said, Perl just dumps the output to the browser, JavaScript runs off the browser plugin. so javascript will be read from the browser and run at the client end.
Reply