|
||||||
| Perl Discussion for the PERL language - Practical Extraction and Reporting Language, is a programming language often used for creating CGI programs. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
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 |
| Sponsored Links |
|
|
|
|||||
|
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 |
|
|||
|
Quote:
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. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
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 |