简体   繁体   中英

jquery running in google app script

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>

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM