I'm having trouble doing this...I tried the following:
<script language="javascript">
quote = '<?php echo $quote; ?>';
</script>
But it does not seem to work. Must I put slashes somewhere I the PHP code? Thanks for any help!
I'm having trouble doing this...I tried the following:
<script language="javascript">
quote = '<?php echo $quote; ?>';
</script>
But it does not seem to work. Must I put slashes somewhere I the PHP code? Thanks for any help!
What are you trying to do? What's in $quote? This could be your problem.
Originally posted by ctimmer
What are you trying to do? What's in $quote? This could be your problem.
$quote is mainly HTML.
Is there a single quote in $quote? I've had this problem before.
try
<script language="javascript">
var quote = '<?php echo addslashes($quote); ?>';
alert(quote);
</script>
Originally posted by sarahk
try
<script language="javascript"> var quote = '<?php echo addslashes($quote); ?>'; alert(quote); </script>
[/B]
Success! Thanks!