I have a google apps script html sidebar that works, except the google.script.run.withSuccessHandler function:
let html = "<h1>DriveSocial</h1>
<input type='search' id='search'>
<script type='text/javascript'>
let searchBar = document.getElementById('search');
searchBar.onsearch = function() {
google.script.run.withSuccessHandler(showResult).withFailureHandler(fail).searchHashTags(searchBar.value);
}
function showResult(html) {
document.write(html);
}
function fail() {
alert('error');
}
</script>";
The document never rewrites itself.
the searchHashTags
function is fully debugged, I tried just searchBar
instead of searchBar.value
, but it still wouldn’t return. Even the failure handler didn’t say anything.