小编T-L*_*T-L的帖子

onclick函数自动运行

使用谷歌应用程序脚本我无法运行传递参数的js函数.当我添加参数时,它将始终在页面加载时运行代码,而不是单击按钮时.

直接从HtmlService示例,它是正常的 - 它按下按钮时运行...

document.getElementById('button1').onclick = doSomething;
Run Code Online (Sandbox Code Playgroud)

但是当我在调用(和函数)中添加一个参数时,它会在页面加载时运行一次(而不是按下按钮时)...

document.getElementById('button1').onclick = doSomething('with_this_parameter');
Run Code Online (Sandbox Code Playgroud)

如果答案显而易见,那么对此行为的任何见解都将非常感激...对不起!

javascript web-applications google-apps-script dom-events

15
推荐指数
2
解决办法
2万
查看次数

移动设备放大 Google Apps 脚本

我在 GAS 中制作了一个 400 像素宽的网络应用程序。我希望在加载时缩放以填充移动设备的屏幕,而不是仅填充屏幕的一半(尽管仍然使用固定的像素宽度)。

我试过使用下面的视口代码但没有运气。

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, user-scalable=yes" />
Run Code Online (Sandbox Code Playgroud)

html mobile web-applications google-apps-script

5
推荐指数
2
解决办法
3793
查看次数