Home > Article > PHP Framework > 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:
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!