我在urss中将参数值发送到appsscript中的html,但是无法识别它。 我无法将变量的值从url中的参数传递给html appscript。
你可以帮助我,我已经尝试了一切,但是没有用。 在下面显示一个例子
地址
https://script.google.com/a/<#######>/s/<script>/exec?clave=hola
Código.gs
function doGet(e) {
var template = HtmlService.createTemplateFromFile('Index');
template.clave=e.parameter.clave
return template.evaluate()
.setTitle('page')
.setSandboxMode(HtmlService.SandboxMode.IFRAME);
}
的index.html
<!DOCTYPE html>
<html>
<body>
<label for="id-cfolio" id="id-lfolio">field : </label><input type="text" size="6" id="id-cfolio" readonly />
</body>
</html>
JavaScript.html
$(document).ready(function(){
document.getElementById("id-cfolio").value = clave;
}
答案 0 :(得分:0)
使用Javascript:
$(document).ready(function(){
document.getElementById("id-cfolio").value = <?=clave?>;
}