Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Adding single quote to javascript/php block

Reply
Thread Tools

Adding single quote to javascript/php block

 
 
Rich
Guest
Posts: n/a
 
      02-26-2004
I have a block of code that calls a function to copy some text to the
clipboard. The text includes some text and an email from a recordset.
I am trying to put the email address inside a single quote however
any PHP or javascript methods that I try to use causes the function
not to work. If I want to add a single quote should I put it inside
the php echo or in between? and if so how should I format?


<span onclick='return copy_clip("<?php echo 'The payers email is ';
?><?php echo $row_rsPayments['payer_email']; ?>")'>Click Here</span>
 
Reply With Quote
 
 
 
 
Stuart Palmer
Guest
Posts: n/a
 
      02-26-2004
Rich,
Here is the code you want your PHP to output:
<span onclick="alert('The payers email is \'(E-Mail Removed)\'');">Click
Here</span>

the \' cancels out the special meaning of the ' so just displays ' instead.

Stu

"Rich" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> I have a block of code that calls a function to copy some text to the
> clipboard. The text includes some text and an email from a recordset.
> I am trying to put the email address inside a single quote however
> any PHP or javascript methods that I try to use causes the function
> not to work. If I want to add a single quote should I put it inside
> the php echo or in between? and if so how should I format?
>
>
> <span onclick='return copy_clip("<?php echo 'The payers email is ';
> ?><?php echo $row_rsPayments['payer_email']; ?>")'>Click Here</span>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with single-quote and double-quote when using subprocess. Evan Python 3 11-04-2008 12:24 PM
problem with quote and single-quote when using "subprocess" Evan Python 1 11-04-2008 12:08 AM
How to handling string contains single quote and double quote vikrant Perl Misc 8 05-17-2007 04:37 PM
Datagrid on load; replace all double single quote to single quote to display to user Eric Layman ASP .Net 3 04-14-2007 07:16 AM
Single Quote Versus Double Quote In A href link knee-dragger@hotmail.com HTML 3 06-13-2006 12:42 AM



Advertisments