Go to Post You do use CAD to prototype, Cardboard Aided Design. - Peter Matteson [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 22-08-2006, 07:23
TomS TomS is offline
Registered User
no team
 
Join Date: Aug 2006
Location: Kiew
Posts: 3
TomS is an unknown quantity at this point
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 href='"" . $me . ""?C=OFERTAS2&EMPRESA="".$empresa_param.""&NREF="" .$nref.""' onMouseOver=""linkFTecnica(nref2)"">"";

What is bad in this code?

Thank you very much. "
__________________
Content hosting - Fixed rate loans
  #2   Spotlight this post!  
Unread 22-08-2006, 07:28
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: How I can execute Javascript into Perl?

Are you trying to get the Javascript to execute inside of perl program or just trying to have the perl program output javascript? I'm a tad confused.
__________________

  #3   Spotlight this post!  
Unread 22-08-2006, 15:39
Noah Kleinberg Noah Kleinberg is offline
Registered User
FRC #0395 (2TrainRobotics)
Team Role: Driver
 
Join Date: Jan 2006
Rookie Year: 2006
Location: New York
Posts: 196
Noah Kleinberg is a splendid one to beholdNoah Kleinberg is a splendid one to beholdNoah Kleinberg is a splendid one to beholdNoah Kleinberg is a splendid one to beholdNoah Kleinberg is a splendid one to beholdNoah Kleinberg is a splendid one to behold
Send a message via AIM to Noah Kleinberg
Re: How I can execute Javascript into Perl?

Quote:
Originally Posted by TomS
$datos=$datos.""<a href='"" . $me . ""?C=OFERTAS2&EMPRESA="".$empresa_param.""&NREF="" .$nref.""' onMouseOver=""linkFTecnica(nref2)"">"";

What is bad in this code?
Is the 'linkFTecnica' function in the javascript, or is it a perl function?

If it is a perl function, then you need
Code:
onMouseOver=" . linkFTecnica(nref2) . ">";
if it's a javascript function, then the quotes around that are being seen by perl, and it thinks that linkFTecnica(nref2) is not part of the variable "$datos"

Hope this helped.
  #4   Spotlight this post!  
Unread 22-08-2006, 16:35
Dave Scheck's Avatar
Dave Scheck Dave Scheck is offline
Registered User
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Feb 2003
Rookie Year: 2002
Location: Arlington Heights, IL
Posts: 574
Dave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond repute
Re: How I can execute Javascript into Perl?

Do you get an error that looks something like this?
Code:
Bareword found where operator expected at test.pl line 1, near "'"" . $me . ""?C=OFERTAS2&EMPRESA="".$empresa_param.""&NREF="".$nref.""' onMouseOver"
        (Missing operator before onMouseOver?)
Bareword found where operator expected at test.pl line 1, near """linkFTecnica"
        (Missing operator before linkFTecnica?)
String found where operator expected at test.pl line 1, near ")"""
        (Missing operator before ""?)
syntax error at test.pl line 1, near "'"" . $me . ""?C=OFERTAS2&EMPRESA="".$empresa_param.""&NREF="".$nref.""' onMouseOver"
This would be because you aren't creating your string properly. If you're trying to append a string to $dateos, you want your code to be like this
Code:
# assuming linkFTecnica is a perl function
$datos = $datos . "<a href='" . $me . "?C=OFERTAS2&EMPRESA=" . $empresa_param . "&NREF=" . $nref . "'onMouseOver=" . linkFTecnica(nref2) . ">";
-- or --
# assuming linkFTecnica is a perl function
$datos = $datos . "<a href='$me?C=OFERTAS2&EMPRESA=$empresa_param&NREF=$nref' onMouseOver=" . linkFTecnica(nref2) . ">";
-- or --
# Assuming that linkFTecnica is a JS function (which it probably is)
$datos = $datos . "<a href='$me?C=OFERTAS2&EMPRESA=$empresa_param&NREF=$nref' onMouseOver=linkFTecnica(nref2)>";
The difference between my code and yours is that you're using "" for some reason to open and close your string. Are you trying to escape them or something? If so, you want to use \" instead of ""

Also, remember that when you put a scalar variable within double quotes that it gets expanded.
Code:
$x = "test";
$y = "This is a $x";
results in $y being "This is a test". If you get into problems like this
Code:
$x = "test";
$y = "This_is_a_$x_with_underscores"
you will need to resolve it in one of the following ways
Code:
$x = "test";
$y = "This_is_a_" . $test . "_with_underscores";
$y = "This_is_a_${x}_with_underscores";
Hope that points you in the right direction.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How much planning goes into your robot? Jnadke General Forum 41 29-01-2006 21:29
Javascript and .ocx lantian329 Programming 2 12-12-2005 23:59
javascript ate my cereal! steveg IT / Communications 2 29-03-2004 01:10
Javascript onclick link concatination Trashed20 Website Design/Showcase 10 04-06-2003 11:18
How much time do you put into building your robot Wayne Doenges General Forum 16 29-01-2002 19:30


All times are GMT -5. The time now is 18:45.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi