我正在使用Google脚本构建一个web应用程序,希望复制一个多页面的站点,并且很难得到历史的改变来做我想做的事情。
我在使用google.script.history.push()
的事件侦听器中设置了如下链接:
document.getElementById('navPage1').addEventListener('click', function() {
google.script.history.push({timestamp:new Date().getTime(),page:'page1'}, {page:'page1'})
});
当我点击这个链接时,我会看到相应的带有参数的update (即https://script.google.com/a/XXX/macros/s/XXX/dev?page=page1)。
然后,在我的HTML文件中,我希望使用google.script.history.setChangeHistory()
来检测这些更改并相应地加载内容。然而,这一事件似乎根本没有触发。我现在设置它只是为了登录历史变化,而我根本没有看到任何东西:
google.script.history.setChangeHandler(function(e) {
console.log('History Change Triggered');
});
我是否误解了这些应该如何使用?
https://stackoverflow.com/questions/60802438
复制相似问题