Tuesday, 22 April 2014

PHP in Jquery:: Demonstration: How to use PHP variable in Jquery!

This is just a small example to demonstrate the use of php variable in Jquery function.


<?php
 
    $name = "Danish";
 
    
    $js = <<<EOP
        <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                 alert(Hello+'$name');
            });
        </script>
EOP;


?>


No comments:

Post a Comment