Passing php to jquery
Passing php to jquery
I have a PHP variable called $successSent
I have this bit of jquery
- $(document).ready(function(){
- var success = '<?php echo $successSent; ?>';
- alert(success);
- });
But alert(success); says <?php echo $successSent; ?> not the value of $successSent. I though you could pass PHP to query that way? What am I doing wrong? Thanks