Cause Analysis of Yii2 inline script loading failure caused by Pjax in Yii2, yii2pjax. Cause Analysis of Yii2 inline script loading failure caused by Pjax in Yii2. An error occurred when I loaded ActiveForm of Yii2 using defunktjquery-pjax, normally, it is the cause analysis of Yii2 inline script loading failure caused by Activ's use of Pjax in Yii2, yii2pjax
An error occurs when I use defunkt/jquery-pjax to load the ActiveForm of Yii2. normally
The two js codes of ActiveForm should be loaded first, but the actual situation is:
TypeError: JQuery (...). yiiActiveForm is not a function.
This issue has been discussed and resolved in issues on github.
Pjax first executes the inline script through html (), and then executes the script with src through executeScriptTags (), so the yiiActiveForm cannot be found. Pjax authors refuse to use JQuery. getScript () to solve this problem, because the function uses eval for Security reasons and does not comply with the CSP (Content Security Policy)
The above section describes the analysis of the causes of failed loading of Yii2 inline scripts using Pjax in Yii2. we hope to help you with the above!
Articles you may be interested in:
- Learning YII2 framework (6) advanced application templates from scratch
- Learn how to use YII2 framework (5) quick code generation tool Gii from scratch
- YII2 framework (IV) extension plug-in yii2-kartikgii from scratch
- YII2 framework (III) extension plug-in yii2-gird from scratch
- YII2 framework from scratch (2) Install extension plug-ins through Composer
Handler an error occurs when I use defunkt/jquery-pjax to load the ActiveForm of Yii2. Normally it is Activ...