Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: CGI, Javascript and Single Quotes

by ptum (Priest)
on Nov 15, 2006 at 16:14 UTC ( [id://584190]=note: print w/replies, xml ) Need Help??


in reply to CGI, Javascript and Single Quotes

Hmmmm. I don't see the problem ... the following sample code seems to work for me:

#!/usr/local/bin/perl use strict; use warnings; use CGI qw/:standard :html3/; print header; my $test_button = button(-name=>'Test',-value=>'Test Val',-onClick=>"r +eturn test('Testing!');"); print start_html(); print <<JAVASCRIPT; <script> function test (message) { alert(message); } </script> JAVASCRIPT print startform(); print $test_button; print endform(); print end_html();

Replies are listed 'Best First'.
Re^2: CGI, Javascript and Single Quotes
by rashley (Scribe) on Nov 15, 2006 at 18:26 UTC
    I tried this. The only difference is that instead of prints I used  result .= $test_button;

    I still get the incorrect results.

      It seems likely to me that there is some simple problem that you (and we) are overlooking. Please post a concise (yet complete) example of your code and clearly identify the result that you are seeing (and what you want to happen).

      If this problem strays very far into Javascript issues, you may be better off getting help elsewhere, although many monks do know quite a bit about Javascript. While we're on that topic, what browser (version) are you using to run your code, and on what platform?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://584190]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2024-04-24 17:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found