Это небольшой пример, который я создал:
Мой файл index.html:
Код: Выделить всё
Click Me
This is my DIV I want to Reveal/Hide.
Код: Выделить всё
function doGet() {
var template = HtmlService.createTemplateFromFile("index.html");
var html = template.evaluate();
return HtmlService.createHtmlOutput(html);
}
function myFunction() {
var x = document.getElementById("myDIV");/*Where the Reference Error Shows Up*/
if (x.style.display === "none") {
x.style.display = "block";
}
else {
x.style.display = "none";
}
}
Я предполагаю, что проблема в том, что мне следует использовать не document.getElementByID(), а что-то еще.getElementByID(), но я не знаю, что это за что-то еще. Большинство случаев, которые я ищу в Интернете, не относятся только к Google Web Apps. Любая помощь будет оценена по достоинству.
Подробнее здесь: https://stackoverflow.com/questions/535 ... h-function
Мобильная версия