Reputation: 332
I have included the following jquery meta-tag to the new html5 file as required by the new google apps script HTML service API , however it seemed that the jquery syntax is not working , as shown by below code snippet which display array return value from successful server call?
I still force to format using standard css or HTML tag to generate the required output instead of much neat jQuery syntax call.
<!DOCTYPE html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<input type="text" id='file_txt' size='100' value="" style="visibility:hidden" readonly/>
<p></p>
<a id="Hyperlink" style="visibility:hidden">File Location</a>
<script>
function rep1(linkid){
//$("Hyperlink").show();
x=document.getElementById("Hyperlink");
x.style.visibility="visible";
x.href=linkid[1];
x.text="File HyperLink :"+linkid[0];
y=document.getElementById("file_txt");
y.value=linkid[2];
y.style.visibility='visible';
y.style.color='red';
}
google.script.run
.withSuccessHandler(rep1)
.onOpen1();
</script>
Upvotes: 1
Views: 922
Reputation: 7367
Although the documentation for HtmlService states that all recent JQuery libraries are compatible, I have had trouble with versions higher than 1.9.1.
Try:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
instead
Upvotes: 2