Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript/Perl problem

Status
Not open for further replies.

altaratz

ISP
Apr 15, 2001
73
US
Hi all - I posted this on the Perl thread - to no avail.

I'm attempting to create a javascript with a cgi script for word definititions (a little tool tip with the definition comes up onMouseover) The thing is, for the javascript to work, teh code has to be on 1 line, but Perl is outputting 2 lines of HTML - and the script won't work. I'm not putting any \n anywhere.

Here is what the line should look like to work:

<A HREF=&quot;docs.html&quot; onMouseOver=&quot;drs('The lady superior of a nunnery.'); return true;&quot; onMouseOut=&quot;nd(); return true;&quot;>abbess</A>.

Here is what the Perl turns it into:

<A HREF=&quot;docs.html&quot; onMouseOver=&quot;drs('The lady superior of a nunnery.
'); return true;&quot; onMouseOut=&quot;nd(); return true;&quot;>abbess</A>.

And here is the relevant Perl scripting:

{


print &quot;$msg)\ <A HREF=\&quot;docs.html\&quot; onMouseOver=\&quot;drs(\'$definition\')\; return true\;\&quot; onMouseOut=\&quot;nd()\; return true\;\&quot;>$word</A>.\ \ \ \ \ &quot;;


Below are teo links - the first to a sample page that works


and to one that doesn't


You'll see that the only difference is that the javascript is on 2 separate lines of code - any suggestions would be wonderful!!

Ethan
 
Just a stab, here, but doesn't Perl often automatically add a newline at the end of the last argument when a script is called? (As if someone had typed the script name, added an argument, then hit ENTER). You might just have to chomp off the newline.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top