jquery - Google Apps 脚本支持哪个版本的 jQuery?

标签 jquery google-apps-script

在版本 1.8.3 的 HTMLService 中使用 jQuery 时,我的脚本运行良好...

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

...但最新版本失败了

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

我在帮助页面上搜索了信息,但找不到支持哪些版本。

最佳答案

第三方库会经过 Caja 清理,因此每次发布新版本的 jQuery 时都可能会出现一些问题。 目前最新的 jquery 版本是 1.11.0

您可以在 http://caja.appspot.com/ 上进行测试使用这样的代码

<html>
  <head>
   <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
    <script>
    $( document ).ready(function() {
      $("span").text("Working");
    });
    </script>
  </head>
  <body>
   <span>Not Working</span>
  </body>
</html>​​​​​​​​​​​​​​​​​​​​​​​​​​

如果您尝试“哄骗”此代码,您将在“渲染结果”选项卡中看到“正在工作”,否则会显示令人悲伤的“不工作”。 尝试更改jquery的版本并进行测试。

更新:现在 1.11.1 正在运行

关于jquery - Google Apps 脚本支持哪个版本的 jQuery?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24951019/

相关文章:

javascript - jquery 仅在选择时显示 id 选项 {help}

javascript - onClick 与 foreach css 更改 jquery

javascript - 如何调整传单 map 的大小?

c# - Apps 脚本 API 响应没有 "result" key

google-apps-script - 如何在 Google Apps 脚本中缓存对象

jquery slide 使用 css3 transitions 多次使用

javascript - 奇怪的 CSS 位置正确 :0 issue

javascript - 仅生成一张电子表格的 PDF

javascript - 将 Google Sheet 转换为多级 JSON 数组

google-apps-script - 类型错误 : Cannot read property "range" from undefined