编程语言
首页 > 编程语言> > javascript – Google应用中的Google应用脚本location.reload

javascript – Google应用中的Google应用脚本location.reload

作者:互联网

我正在使用GAS Web应用程序,当用户执行某些操作(例如单击特定div)时需要刷新其内容.

在客户端,我有这个脚本从onclick调用

google.script.run.withSuccessHandler(refreshCallback).myServersideFunction();

function refreshCallback(roomsPlus) {
    var statusDiv = document.getElementById("status");
    statusDiv.innerHTML = "Reloading...";
    window.location.reload(true);
};

状态div更改为“重新加载…”所以我知道回调被调用,但它永远不会重新加载页面. Caja或谷歌应用脚​​本是否会禁用页面刷新?还有另一种刷新页面的方法吗?

解决方法:

编辑

Caja于2016年7月16日从Web App HtmlService中删除.

Native Sandbox Mode

An Update to HTML Service

编辑结束

不幸的是,HtmlService使用的Caja清理引擎限制了对窗口对象的访问,阻止您以编程方式重新加载页面.这是对服务的已知限制,我们正在努力更好地记录它.

标签:javascript,reload,google-apps-script,html,window-location
来源: https://codeday.me/bug/20190520/1143444.html