I’m trying to use php tag in a javascript function. But unfortunately its not working. I even used <?php but still not working. I checked php.ini file and there the short tag is already enabled.
Any sort of suggestion will be appreciated.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should be aware that a php tag inside javascript gets evaluated on the serverside before it gets sent to the client. Example: If the php variable
$feelingholds the string “love” “I love cheese.” gets alerted.In that case the javascript code that gets returned from the server will look like:
I hope this will be of help to you to solve your issue.