Lost Password?

Go Back   CodeCall Programming Forum > Web Development Forum > Perl

Perl Discussion for the PERL language - Practical Extraction and Reporting Language, is a programming language often used for creating CGI programs.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-01-2007, 12:44 PM
tony.willson tony.willson is offline
Newbie
 
Join Date: Nov 2007
Posts: 3
Rep Power: 0
tony.willson is on a distinguished road
Default How I can execute Javascript into Perl?

I don't know how I can execute an event of Javascript into a link in a program in Perl.
This event of JavaScript have executed a function that return a HTML page.
Anybody know how I can it?

Is it possible do it this?:
$datos=$datos.""<a>"";

What is bad in this code?

Thank you very much.
__________________
Get inkjet cartridges at LowerPriceUSA.com credit cards for bad credit no annual fee
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 12-08-2007, 06:43 PM
KevinADC KevinADC is offline
Learning Programmer
 
Join Date: Jan 2007
Posts: 87
Rep Power: 6
KevinADC is on a distinguished road
Default

I may not understand your question, but you can't execute javascript in perl code. Maybe you can look into AJAX.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 12-09-2007, 01:31 AM
fahlyn's Avatar   
fahlyn fahlyn is offline
Learning Programmer
 
Join Date: Nov 2007
Age: 25
Posts: 35
Rep Power: 3
fahlyn is on a distinguished road
Send a message via ICQ to fahlyn Send a message via AIM to fahlyn Send a message via MSN to fahlyn Send a message via Yahoo to fahlyn
Default

Your question doesn't make sense at all. I think there are a few things you need to understand first.

1. JavaScript is executed on the client - in the browser after the page has been rendered.
2. Perl is executed on the server to either create a document to send to the client or to accept something submitted from the client (like a form being submitted or a link being clicked).


There is a complete separation between JavaScript and Perl, you can't execute one from the other. You can use Perl to generate JavaScript and send it to the client to be executed...or you can use JavaScript to send an HTTP request to the server to execute Perl and return a reply (HTML, XML, JSON or text) to the JavaScript that sent the HTTP request (this is Ajax which Kevin mentioned).

Again, I've got no idea what you're asking - can you maybe try to re-work your question or post more than just one line of code?
__________________
Visit My Google Group Here: Web Development Innovation
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 12-14-2007, 10:58 AM
jonmacpherson jonmacpherson is offline
Newbie
 
Join Date: Dec 2007
Posts: 7
Rep Power: 0
jonmacpherson is on a distinguished road
Wink

Quote:
Originally Posted by tony.willson View Post
I don't know how I can execute an event of Javascript into a link in a program in Perl.
This event of JavaScript have executed a function that return a HTML page.
Anybody know how I can it?

Is it possible do it this?:
$datos=$datos.""<a>"";

What is bad in this code?

Thank you very much.

Well, The first thing that jumps out at me is the string. The code should look like this:

$datos = $datos . "\"<a>\"";

You have to use the \ (escape character) to send a " (double quote) character from a " double qouted string.
You could also write the code as follows:

$datos = $datos . '"<a>"'; # Note the use of single qoutes.

As far as writing javascript in perl, here is how you could send javascript to the client, from perl:

print "<script type=\"text/javascript\">";
print "var one = 1;";
print "var two = 3;";
print "</script>";

but that is just javascript output, not actually javascript being executed in perl. I do not think there is a way to directly introduce javascript code in perl.

You may be able to write a seperate javascript program, and somehow run a system call to execute it....

system(" dos/linux command ");

But thats all I can think of.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl text parse help (noob) dfp Perl 4 11-23-2007 01:57 PM
Looking for expert perl freelancer hhheng Request Services (Paid) 1 11-12-2007 04:53 PM
Perl is Dead. Long live Perl. Kernel Programming News 3 08-10-2007 10:49 AM
Counting Files with JavaScript Matt JavaScript and CSS 5 08-01-2007 12:02 PM
Perl Tutorial Course for Windows priorityone Perl 22 02-11-2007 12:57 AM


All times are GMT -5. The time now is 01:54 AM.

Contest Stats

dargueta ........ 128.00000
John ........ 127.00000
Xav ........ 107.00000
gaylo565 ........ 18.00000
Johnnyboy ........ 3.00000
navghost ........ 1.00000

Contest Rules

Ads