Home >PHP Framework >YII >The jq code written in yii does not take effect

The jq code written in yii does not take effect

王林
王林Original
2020-02-18 14:39:073074browse

The jq code written in yii does not take effect

You can put the JS code into $this->registerJS() in the view, which will ensure that the JS code is below the JS library.

is as follows:

$this->registerJs('alert(1)');

(Recommended tutorial: yii framework)

Of course, your JS code may not be so simple. And ensure the readability of multi-line JS code. You can first put it in the code block of the view, as shown below:

The jq code written in yii does not take effect

For more programming-related content, please pay attention to the Programming Introduction column on the PHP Chinese website !

The above is the detailed content of The jq code written in yii does not take effect. For more information, please follow other related articles on the PHP Chinese website!

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