All you need to do is use:
window.open("https://script.google.com/macros/s/web_app_ID/dev",'_top');
My original answer below works, but is un-needed:
There is a programmatic "Work Around" to reload/refresh the page in an Apps Script Web App. It is based on the capability of an html link tag to reload the page, and the ability of JavaScript to invoke the click event on that tag. You can hide the link if you want.
- Add a link tag to your HTML
- Hide the link tag if you wish
- Add client side code in a script tag to invoke the click event on the link tag
- Run the code however you want
Test Button:
<button onmouseup="reloadTheWebApp()">Trigger the Link Tag</button>
Link:
<a id="testLink" style="display:none"
href="https://script.google.com/macros/s/script_ID/exec">Reload the Web App</a>
Script:
<script>
window.reloadTheWebApp = function() {
console.log('reloadTheWebApp ran');
var linkTag = document.getElementById('testLink');
linkTag.click();
}
</script>
It may be preferable to implement a simple page navigation system:
Page Navigation Web App - Apps Script
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…