Automatically Redirecting to a Page

后端 未结 2 1729
忘掉有多难
忘掉有多难 2020-12-05 20:14

Inside a button click handler, I\'m creating a new web page like so:

var page = SitesApp.getPageByUrl(url).createPageFromTemplate(title, name, template);
         


        
2条回答
  •  孤城傲影
    2020-12-05 20:54

    Corey G's answer worked for me, but the problem is that the web page that I was redirecting was embedded into an iframe in the response of the GAS, so the real URL in the web browser was the script's one.

    This is what actually worked for me:

    function doGet() {
      return HtmlService.createHtmlOutput(
        ""
      );
    }
    

    This similar Q/A helped me to solve it.

    Hope it helps.

提交回复
热议问题