简体   繁体   English

在 Google 网站的嵌入式 web 应用程序中不能有链接?

[英]Can't have link in Embedded web app in Google site?

I'm trying to integrate a google script app deployed as a web app in a Google Site.我正在尝试将部署为 web 应用程序的 Google 脚本应用程序集成到 Google 站点中。 The embedding feature works well and all seems good at first.嵌入功能运行良好,一开始看起来一切都很好。 But for some reason links don't work in the embedded view.但由于某种原因,链接在嵌入视图中不起作用。 I can't find any specific topics about this.我找不到任何关于此的特定主题。

Google Script web app can be embedded everywhere I tried except in Google Site. Google Script web 应用程序可以嵌入到我尝试过的任何地方,除了 Google Site。 And Google Site can embed every site that allow it except web app from google script.谷歌站点可以嵌入所有允许它的站点,除了来自谷歌脚本的 web 应用程序。

EDIT (2)编辑 (2)

Turn out the problem can be resolved pretty quickly:原来问题可以很快解决:

  1. Open https://sites.google.com and create a new site打开https://sites.google.com并创建一个新站点

  2. Insert an "embed" choose the "embed code" option and copy paste this code:插入“嵌入”选择“嵌入代码”选项并复制粘贴此代码:

     <:DOCTYPE html> <html> <body> <div> <a href="http.//google.com">Click Me!</a> </div> </body> </html>
  3. Now testing on preview or once the site publish the link can't be clicked现在测试预览或一旦网站发布链接无法点击

You have to specified the target propriety.您必须指定目标属性。 Google script dont apply it by default so use this code: Google 脚本默认情况下不应用它,因此请使用以下代码:

<!DOCTYPE html>
<html>
 <body>
   <div>
     <a target="_self" href="http://google.com">Click Me!</a>
   </div>
 </body>
</html>

FYI: I tried target="_self" and could not get it to work.仅供参考:我尝试了 target="_self" 但无法正常工作。 The below is currently working for me.以下内容目前正在为我工作。 In our use we have the text link and an image as an icon for the href.在我们的使用中,我们有文本链接和图像作为 href 的图标。 Please note the scriplet is the URL.请注意,脚本是 URL。 target="_blank" and with rel="noopener noreferrer" seems to have made the difference. target="_blank" 和 rel="noopener noreferrer" 似乎有所作为。 I didn't delve too far into why but this article seemed to proved better explanation than other documentation I reviewed: https://pointjupiter.com/what-noopener-noreferrer-nofollow-explained/我没有深入研究原因,但这篇文章似乎证明比我查看的其他文档更好的解释: https://pointjupiter.com/what-noopener-noreferrer-nofollow-explained/

<a target="_blank" href=<?=edGoogleDriveId?>><img src='google-drive.png'   alt="Google Drive icon" rel="noopener noreferrer" class='icon';/>Employee folder</a>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 html网站中的下载链接无法显示对话框 - download link in an html web site can't showing dialog box 当应用程序脚本部署为 Web 应用程序时,任何知道链接的人都可以在 Google Drive 中查看图像,但在 IOS 的 Web 浏览器中不显示 - Anyone with the link can view images in Google Drive when deploy as a web app by apps script doesn't show in web browser in IOS 如何使提交功能在使用 Google Apps 脚本创建并嵌入 Google 站点的 Web 表单中工作? - How to make submission function work in a web form that is created using Google Apps Script and embedded in a Google Site? Google App Engine 出现意外的“站点无法提供安全连接”错误 - Google App Engine unexpected 'site can't provide a secure connection' error 为什么我不能直接链接到site.url? - Why can't I just link to site.url? Bootstrap - 网站的主标题,无法获得链接的徽标 - Bootstrap - Main header of site, can't get logos to link 嵌入在网页中的Google表格 - Google Sheets embedded in web page 无法调整地图信息窗口中嵌入的Google Spreadsheet的大小 - Can't resize Google Spreadsheet embedded in Maps infowindow 如何仅在谷歌网站上刷新嵌入的内容? - How to refresh an embedded content only on google site? Google CSE-我可以将页面本身嵌入到我的网站中,而不是从结果视图重定向到页面吗? - Google CSE - instead of redirecting to a page from the results view can I display the page itself embedded on my site?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM