Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
72 views
in Technique[技术] by (71.8m points)

javascript - reload deployed html page from a button Google sheets

I have a D3 chart that I have deployed as an HTML page and I want to refresh this page from a button

When I click the button the page does not refresh and the chart disappears

If I manually refresh the page the chart returns. You can see this here:

https://script.google.com/macros/s/AKfycbwaU-Pd6Q9sLmW_xXRQ31m1BsFIJlwYR9yGD6Lk0MYEHxMj294jujE/exec

I have

<!DOCTYPE html>
<meta charset="utf-8">
<!-- styles -->
<html>
  <head>
   <?!= HtmlService.createHtmlOutputFromFile("styles.css").getContent(); ?>
  </head>

  <body>
    <div class="content">

      <h1>d3 chart powered by data from Google Sheet</h1>
      
      <input type="button" value="Reload Page" onClick="document.location.reload(true)"><br>
        
</div>
 <svg class="chart" width = "500" height = "500"></svg>
<!-- javascript -->
<script type="text/javascript" src="https://d3js.org/d3.v4.min.js"></script>
<?!= HtmlService.createHtmlOutputFromFile("chart.js").getContent() ?>
<?!= HtmlService.createHtmlOutputFromFile("main.js").getContent() ?>
</body>
</html>
question from:https://stackoverflow.com/questions/65891653/reload-deployed-html-page-from-a-button-google-sheets

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...