表单提交上的白色屏幕 - 谷歌网络应用程序

时间:2017-01-16 17:35:35

标签: javascript html google-apps-script google-apps

我继续按下提交按钮时出现白屏。我尝试了很多技巧,只能获得白屏。关于可能出错的任何想法?

Html文件:



<!DOCTYPE html>
<html>
  <head>
    <base target="_top">
          <script>
  function handleFormSubmit(formObject) {
    google.script.run.withSuccessHandler(updateUrl).processForm(formObject);
  }
    function onFailure(error) {
    var div = document.getElementById('output');
    div.innerHTML = "ERROR: " + error.message;
  }
    </script>
  </head>
  <body>
    Hello, World!
     <form id="myForm" onsubmit="handleFormSubmit(this)">
      <input type="text" name="search">
      <input type="submit" value="Submit" />
      
    </form>
    <input type="button" value="Close"
        onclick="google.script.host.close()" />
        
     
  </body>
</html>
&#13;
&#13;
&#13;

Code.gs:

&#13;
&#13;
function processForm(formObject) {
Logger.log('Form was submitted!');
   var missVar = 999;
   var html = HtmlService.createTemplateFromFile('missingVar');
   html.missingVar = missVar;
   var htmlOutput = html.evaluate();

  
  
}
&#13;
&#13;
&#13;

missingvar.html:

&#13;
&#13;
<!DOCTYPE html>
<html>
  <head>
    <base target="_top">
  </head>
  <body>
    hello!!
    <?= missingVar ?>
    
  </body>
</html>
&#13;
&#13;
&#13;

0 个答案:

没有答案