Multi-page site in Google Apps Script: How to invoke doGet() through jquery or javascript?

前端 未结 2 1732
无人及你
无人及你 2021-01-07 09:37

I want to build multi-page sites using Google Apps Script. To do this, I would like to exploit the ability of doGet() to process query strings. I am aware of at

2条回答
  •  爱一瞬间的悲伤
    2021-01-07 10:35

    Aha! The above code will work properly if you change

    window.open(newURL,"_self");
    

    to

    window.open(newURL,"_top");
    

    I am not sure why "_top" is necessary, but in the example code above, it makes all the difference: doGet() is invoked with the proper query string, resulting in the expected page being served. Hooray! This approach to serving new web pages on the fly provides a powerful alternative to templated HTML. Enjoy!

提交回复
热议问题