0

I'm creating a webapge using Google App Script. After a button click I'm trying to reload a page and none of the below work,

  1. window.location.href = window.location.href
  2. window.location.reload(true)

They are redirecting to a blank page

ziganotschka
  • 25,866
  • 2
  • 16
  • 33
  • 1
    Welcome to Stack Overflow. Please read the [guide to web apps in Apps Script](https://developers.google.com/apps-script/guides/web), and [How to Ask Questions](https://stackoverflow.com/help/how-to-ask) – sinaraheneba Aug 14 '19 at 05:27
  • 3
    Possible duplicate of [Can't stop Google Apps Script from masking redirected URL](https://stackoverflow.com/questions/56685553/cant-stop-google-apps-script-from-masking-redirected-url) – TheMaster Aug 14 '19 at 06:05

1 Answers1

1

The below snippet worked

var url = 'myURL'
window.top.location = url
Rubén
  • 34,714
  • 9
  • 70
  • 166
  • Better to make sure that the script contains `````` because it specifies a default target for all hyperlinks and forms on a page. `top` Opens the link in the full body of the window. – Maulik Pipaliya Joyy Mar 26 '22 at 13:25