我刚刚开始使用head.js异步加载带有依赖项的JS文件。
查看API文档和示例,我看到您可以将标签应用于JS文件,然后在加载它们时运行一些条件,下面是它们的文档中的一个示例:
// same as above, but pass files in as an Array
head.load([
{ label1: "file1.js" },
{ label2: "file2.js" }],
function() {
// do something
});
// Labels are usually used in conj
下面的包是用我的ASP.MVC应用程序配置的。
bundles.Add(new ScriptBundle("~/Scripts/Core").Include(
"~/Content/th/assets/global/plugins/jquery.min.js", // Should be first
"~/Content/th/assets/global/plugins/bootstrap/js/bootstrap.min.js",
"~/Co
我的视图中有ActiveForm,我使用$this->addError在模式中对其进行验证。然而,当我用我的活动窗体加载页面时,我在调试控制台中看到:
TypeError: window.jQuery is not a function yii.js:520:1
ReferenceError: jQuery is not defined yii.validation.js:452:1
TypeError: $ is undefined yii.activeForm.js:14:5
jQuery.Deferred exception: jQuery(...).yiiAct
请帮帮忙。当我将jquery添加到几乎为空的站点时,它向我展示了以下内容:
DOMException:在'querySelectorAll‘上执行’querySelectorAll‘失败:'*,:x’不是有效的选择器。错误(本地)在 at ia () at fa.setDocument (http: //localhost/Sites/Humator/www/assets/plugins/jquery/jquery-2.2.3.min.js:2:22073 at http: //localhost/Sites/Humator/www/assets/plugins/jquery
所以,因为我很少犯错误,所以在将本地文件合并到我的开发环境中时,我遇到了冲突。
我在一个Wordpress网站上做维护工作。我首先在本地环境中测试更新,然后将其推送到开发环境中,但我在开发环境中意外地更新了一些插件,而没有注意到这一点。当我注意到我切换到本地文件并在那里进行更新时,当我想要将本地文件合并到dev环境中时,我在我的终端中得到了这个错误。
> * branch develop -> FETCH_HEAD
Updating f08f8fb..c72a8b7
error: The following untracked working tree