davinov
davinov

Reputation: 72

Dynamic redirection in Google Sites with HtmlService

I wish to make a redirection in a Google Apps Script embedded in a Google Site. I use HtmlService: when the user click a button, it starts a function containing window.location = adress_I_want_to_redirect.

Unfortunatly, it doesn't work. I tried with jQuery and $('location').href(adress_I_want_to_redirect) but it doesn't work either (quite logical ^^). Console displays The property 'href' is not writable.

Do you know an other way to do redirection which will work in GAS? Thank you!

Upvotes: 0

Views: 459

Answers (1)

Eric Koleda
Eric Koleda

Reputation: 12673

It may be that the Caja engine is preventing you from doing a redirection like this. You may need to use a regular anchor tag instead.

Upvotes: 1

Related Questions