2016-04-02 63 views
0

我已经创建了一个Google应用程序脚本来显示图像的某些指标。我使用了下面的代码 函数doGet()var output = HtmlService.createHtmlOutputFromFile('cfcgfcg'); output.setSandboxMode(HtmlService.SandboxMode.IFRAME); 返回输出; } 该代码在NATIVE模式下工作正常,但它不适用于IFRAME模式。我曾尝试guidlines想从母语迁移在以下链接 https://developers.google.com/apps-script/migration/iframe#setting_the_link_target_attributeGoogle Apps脚本中的IFRAME和NATIVE模式

到IFRAME给出,但该代码不起作用

以下是我所使用的代码 https://drive.google.com/open?id=1C9_tabVhPq1NhKBjqNATvdC5G9542A8rRqhxpa-BSknx8m19Kts6bsB-

回答

0

看来你使用了错误的URL来加载JQuery的lib下,使用控制台查看使用这一个托管在HTTPS服务器IFRAME模式下的该错误消息 :

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> 
<script src="https://apis.google.com/js/api.js?onload=onApiLoad"></script> 

检查它是否通过添加日志来加载运行

function update() { 
    console.log("update executed"); 
    $.ajaxSetup({ cache: false }); 
    var data=google.script.run.withSuccessHandler(onSuccess).getMyData(); 
    window.setTimeout(update, 500); 
} 
update(); 
+0

非常感谢。它正在使用新版本。 – HSPL