Today when I was wandering around a website forum, I found that a friend asked: How to embed PHP code in JavaScript?
This is a very simple question, so I posted it online to share with everyone, there is no end to learning!
The question is this:
How to embed php code in javascript?
I am a newbie, please don’t find me annoying! Hehe...
A friend answered this way:
alert(" echo 'haha'; ?>");
|
The editor looked at it and found it not very easy to use, so he analyzed the reasons:
Generally JS is done on the template page.
Not many people can write in PHP. Not conducive to modification.
If you want to interact with PHP, you can use
PHP’s JSON. That’s it.
I hope this article will be helpful to PHP beginners. Welcome everyone to come to Agni Website Building Academy frequently!
http://www.bkjia.com/PHPjc/364113.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/364113.htmlTechArticleToday when I was hanging out on a website forum, I found that a friend asked: How to embed PHP code in JavaScript? This is a very simple question, so I posted it online to share with everyone, learn...
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn