jquery 运行 在 google 应用程序脚本中
jquery running in google app script
我已根据新 google 应用程序脚本 HTML 服务 API 的要求将以下 jquery 元标记添加到新 html5 文件中,但是 jquery 语法似乎不起作用,如下面的代码片段所示,它显示来自成功服务器调用的数组 return 值?
我仍然强制使用标准 css 或 HTML 标记来生成所需的输出,而不是更简洁的 jQuery 语法调用。
<!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>
虽然 HtmlService 的文档指出所有最新的 JQuery 库都是兼容的,但我在使用高于 1.9.1 的版本时遇到了问题。
尝试:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
改为
我已根据新 google 应用程序脚本 HTML 服务 API 的要求将以下 jquery 元标记添加到新 html5 文件中,但是 jquery 语法似乎不起作用,如下面的代码片段所示,它显示来自成功服务器调用的数组 return 值?
我仍然强制使用标准 css 或 HTML 标记来生成所需的输出,而不是更简洁的 jQuery 语法调用。
<!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>
虽然 HtmlService 的文档指出所有最新的 JQuery 库都是兼容的,但我在使用高于 1.9.1 的版本时遇到了问题。
尝试:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
改为