【问题标题】:AppMaker Return value from server side to client sideAppMaker 从服务器端返回值到客户端
【发布时间】:2019-07-19 11:55:59
【问题描述】:

我在 AppMaker 页面上有一个在客户端执行功能的按钮

function showall(){
  app.pages.ProjectComposant.children.Html1.html = google.script.run.showhtml();
}

而服务器端的功能是

function showhtml(){
  return "<p>test</p>";
}

但服务器不返回字符串。我尝试使用withSuccessHandler(),但客户端脚本上没有 onSucess 处理程序

还有另一种从服务器获取返回值的方法吗? 坦克

【问题讨论】:

标签: javascript google-app-maker


【解决方案1】:

在服务器端

function showhtml(){
  return JSON.Stringify("<p>test</p>");
}

在客户端

    function showall(){

    google.script.run.withSuccessHandler(
function(returned_result){ 
app.pages.ProjectComposant.children.Html1.html = JSON.Parse(returned_result); 
})
    .showhtml();
    }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-06-22
    • 1970-01-01
    • 1970-01-01
    • 2015-11-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多