Joachin Joseph
Joachin Joseph

Reputation: 343

how to refresh a google site using google apps scripts ?

My site fetches chart from spreadsheet but it is getting updated only when it is refreshed manually. Publishing on web is not working as expected. So Any method to refresh a site is much appreciated. Please do not include browser extensions or plugins or widgets, because of site audience.

Upvotes: 0

Views: 6063

Answers (2)

pht
pht

Reputation: 91

After some hours struggling with this, i found a solution that worked for me. Place this code in Templated HTML file. Then call function reloadSite() in Javascript to reload current site.

<script>
  function reloadSite() {
    window.top.location.href = '<?!= SitesApp.getActivePage().getUrl(); ?>';
  }
</script>

Upvotes: 2

Hann
Hann

Reputation: 713

Should be able to end the onSubmit() with the function that calls the Ui. You state it is doGet(), like this :

function onSubmit(e){

// Your code ...
doGet();
}

Upvotes: 0

Related Questions