Is it okay to use PHP inside a jQuery script?

Viewed 54412

For example:

$(document).ready(function(){
    $('.selector').click(function(){
        <?php
        // php code goes here
        ?>
    });
});

Will this cause issues or slow down the page? Is this bad practice? Is there anything important that I should know related to this?

Thanks!

7 Answers
Related