Browser Pop up in Google Apps Script

前端 未结 1 1697
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-06 19:33

Background: I have prepared a form in HTML Service in Google apps script which I call with DoGet function from Code.gs.

my doget function
function doGet() {
  r         


        
1条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-06 20:05

    A jQuery dialog will suit your needs. It is an overlay to the current window - not a "pop up".

    The demo code here can be easily adapted to Google Apps Script. Here it is, with much of the extra bits removed:

    Screenshot Modal Form

    Code.js

    function doGet() {
      var template = HtmlService
                     .createTemplateFromFile('ModalForm');
    
      var htmlOutput = template.evaluate()
                       .setSandboxMode(HtmlService.SandboxMode.NATIVE)
                       .setTitle('jQuery UI Dialog - Modal form');
    
      return htmlOutput;
    }
    

    ModalForm.html

    
    
    
    
    
    
    
    
    
    

    Existing Users:

    Name Email Password
    John Doe john.doe@example.com johndoe1

    0 讨论(0)
提交回复
热议问题