使用应用程序脚本的Google表格中的边栏不起作用 [英] Sidebar in google sheets using apps script not working

查看:81
本文介绍了使用应用程序脚本的Google表格中的边栏不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Google工作表中构建侧边栏,并为其分配脚本以发送电子邮件. 问题是标题和关闭按钮正确显示,但侧栏的内容未显示,并且出现错误: "n-sf2kk5ynt6qhvo6tzp2uamld3a63ce7qvtsloby-0lu-script.googleusercontent.com花了很长时间才响应."

I'm trying to build a sidebar in my google sheet and assign to it a script to send an emails. The problem is the title and close button displays correctly but the content of the sidebar is not displaying and it gives an error : "n-sf2kk5ynt6qhvo6tzp2uamld3a63ce7qvtsloby-0lu-script.googleusercontent.com took too long to respond."

这是我使用的代码:

  1. interface.gs

function onOpen() {
  SpreadsheetApp.getUi() // Or DocumentApp or SlidesApp or FormApp.
      .createMenu('Control Panel')
      .addItem('Email', 'showEmail')
      .addToUi();
}

function showEmail() {
  var html = HtmlService.createHtmlOutputFromFile('Page')
      .setTitle('Email Panel')
      .setWidth(300);
  SpreadsheetApp.getUi() // Or DocumentApp or SlidesApp or FormApp.
      .showSidebar(html);
}

2.Page.html

2.Page.html

<!DOCTYPE html>
<html>
  <head>
    <base target="_top">
  </head>
  <body>
    <div>Hello World!</div>
    <input type="button" value="Close" onclick="google.script.host.close()" />

  </body>
</html>

推荐答案

问题已解决,很奇怪,这是我的路由器出现的问题,因此重置路由器即可解决该问题,谢谢您的所有帮助.

The issue is solved now, weirdly it was a problem with my router so resetting the router solved it thanks for all the help.

这篇关于使用应用程序脚本的Google表格中的边栏不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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