gpt4 book ai didi

javascript - 更新 jQuery 以与小部件一起使用

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:43:16 27 4
gpt4 key购买 nike

我正在尝试将主要使用 jQuery 1.08 的站点模板升级为使用 1.11,因为我想连接到订阅表单的小部件使用 1.11。

这是我正在使用的模板:

http://multifour.com/projects/ray/ios/image-intro/index.html

奇怪的是,如果我使用以下代码,标题就在那里,但表单无法正常工作:

<script src="scripts/jquery-1.11.0.min.js"></script>

如果我使用这段代码,表单可以工作,但标题会消失:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>

我也不能同时使用两者,因为每当我输入第二行时,标题都会出于某种原因消失。什么给了,有人可以帮助我吗?谢谢!

最佳答案

对于你的第一个问题
我检查了你的目录中的 jQuery 脚本,它返回了 404。也许你更新了它,因为我注意到你的 View 源中加载了不同的 jQuery 版本。

http://multifour.com/projects/ray/ios/image-intro/scripts/jquery-1.11.0.min.js

对于你的第二个问题

Ya, I've actually included the jquery file in the scripts directory and either way I thought reading it in through googleapis would include jquery anyway. The console is reading two errors, saying that $().smoothScrool and $.stellar aren't functions in a custom.js file. If you check out the source code of the template I linked to and bring up the custom.js file (line 498), it's the exact same as the one I'm using locally. Thanks for your help so far, guys.

你应该使用某种 Javascript Loader,因为你的 custom.js 在你的 jQuery 库被加载之前被加载,这就是为什么你会得到错误 $().smoothScrool 和 $.stellar 不是函数。也许试试 HTML5 async Javascript 属性。 http://www.w3schools.com/tags/att_script_async.asp

关于javascript - 更新 jQuery 以与小部件一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29787162/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com