954,523 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how can i call javascript from perlscript??

hi!
i am totally new in perl and i have a problem..i have a search maschine and after every query i call a perl script to do the jod and see the results. i want every time i run the perlscrit to be able to see a progress bar in my web interface. i want to know how can i call a javascript (i have a js progress bar ) from my perl script..??

zisis86
Newbie Poster
1 post since Apr 2011
Reputation Points: 10
Solved Threads: 0
 
Hi, Look at this example here. you can call very simple as standard html Code.
#!/perl/bin/perl -w

my $random_number = int( rand( 10));

print <<HTML;
Content-type: text/html;

<html>
<head>
<title>A Random Number</title>

<script>
var myNumber = $random_number;

function display() {
alert( "Your random number is "+ myNumber);
}
</script>

<style>
.display { padding: 50px; text-align: center; background: lightblue; }
</style>

</head>

<body>
<div class='display' onMouseOver='display();'>HOVER HERE TO SEE THE NUMBER!</div>
</body>

</html>
HTML
Thanks, Senthil. V
senthilamp4
Newbie Poster
14 posts since Oct 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: