I am having difficulty with refreshing the HTML page or div content in a Google Apps Script. I am self-taught at programming so I have very little knowledge in the whole endeavor; please bear with me on my mess of code.
Basically, I have an application that once the user clicks on a button, it changes the information within Google Docs and refreshes the application to show the changes. I need help with the refresh part.
Here is a snippet of the html service part:
<?!= include('Stylesheet'); ?>
<? var data = getData(); ?>
<? var data2 = get2Data(); ?>
...
<div class="inline mainbody">
<div class="title">
</div>
<div class="section group">
<div class="col span_1_of_2">
<div class="newreq">
<table>
<h2>New Requests</h2>
<? for (var i = 0; i < data.length; i++) { ?>
<? for (var j = 0; j < data[i].length; j++) { ?>
<? if ((data[i][23] == 'None') && (data[i][29] != "Done") && (data[i][30] != "Yes") && (data[i][31] != "Yes")) { ?>
<tr>
<td>
<b>Name:</b> <?= data[i][3] ?> <b>School:</b> <?= data[i][5] ?> <b>Program Type:</b> <?= data[i][1] ?><?= data[i][2] ?>
<br>
<p><b>First Choice at:</b> <?= data[i][19] ?> <input onclick="google.script.run.finalTime('<?= data[i][24] ?>','First')" type="button" value="Finalize First Choice">
</p>
<p><b>Second Choice at:</b> <?= data[i][20] ?> <input onclick="google.script.run.finalTime('<?= data[i][24] ?>','Second')" type="button" value="Finalize Second Choice">
</p>
<p><b>Third Choice at:</b> <?= data[i][21] ?> <input onclick="google.script.run.finalTime('<?= data[i][24] ?>','Third')" type="button" value="Finalize Third Choice">
</p>
<p><input onclick="google.script.run.deletePre('<?= data[i][24] ?>')" type="button" value="Delete" class="button">
</p>
<br>
</td>
<? break ?>
<? } ?>
</tr>
<? } ?>
<? } ?>
</table>
</div>
</div>
Basically the script pulls information from the spreadsheet. Is is possible once I click a button, that it refreshes the script or even the page so that the User does not have to manually? I tried searching similar inquires without meaningful result and my attempts of adding ".reload()" and ".html(data)" aren't quite working. Any ideas how I can tackle this?