如何向Google网站添加自定义JavaScript? [英] how to add custom javascript to google sites?

查看:76
本文介绍了如何向Google网站添加自定义JavaScript?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何能够在Google网站站点上添加/编辑JS?这样,我想使用jQuery和jQuery UI来操纵网站的外观.

How do I get the ability to add/edit the JS on a google sites site? This way I want to use jQuery and jQuery UI to manipulate the look and feel of the site.

需要明确的是,我并不是在谈论所有Google网站,只是由Google建立的名为"Google网站"的创建自己的系统->

To be clear, I am not talking about all google sites, just the create-your-own system google has made, called "Google Sites" -> https://sites.google.com/.

方法页面上,这是: 不支持的功能

On the howto page, there is this: Unsupported features

HTML框工具当前不支持以下功能:

The HTML Box tool currently doesn't support the following features:

iframes JavaScript代码无法创建任何脚本,图像或链接标签 文档/窗口的加载和就绪功能.您可以放置​​任何 需要在文档之后加载的代码末尾的JavaScript 加载.

iframes JavaScript code can't create any script, image or link tags Document/window onload and onready functions. You can place any JavaScript at the end of code that needs to load after the document loads.

这是否意味着HTML工具无法创建标签?即使它们在上面的演示中?

Does that mean HTML tool cannot create tags? even though they are in the demo above?

推荐答案

Google协作平台帮助说明了如何添加自定义HTML/CSS/JS内容:

  1. 转到要在其中嵌入HTML的"Google协作平台"页面.
  2. 转到插入"菜单,然后选择"HTML框".
  3. 在打开的对话框中,添加HTML,CSS和/或Javascript代码.
  4. 完成后,单击保存".
  5. 要预览您的嵌入式HTML,请在Google网站页面上单击保存.
  1. Go to the Google Sites page that you’d like to embed HTML in.
  2. Go to the Insert menu and select HTML Box.
  3. In the dialog that opens, add HTML, CSS and/or Javascript code.
  4. When you’re done, click Save.
  5. To preview your embedded HTML, click Save on the Google Site page.

它继续指出,来自一个HTML框的代码不能与该HTML框(包括其他HTML框)交互或引用该HTML框之外的代码"-大概每个"HTML框"都是一个单独的沙盒iframe元素.因此,您使用JS操纵网站外观"的能力将受到很大限制.

It goes on to note that "code from one HTML box can’t interact with or refer to code outside of the HTML box, including other HTML boxes" -- presumably, each "HTML box" is a separately sandboxed iframe element. As such, your ability to use JS to "manipulate the look and feel of the site" will be pretty limited.

这篇关于如何向Google网站添加自定义JavaScript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆