var del = document.createElement('input');
del.type = 'button';
del.name = 'delll';
del.value = 'del';
del.onClick = 'alert("hi javascript")';
Run Code Online (Sandbox Code Playgroud)
这里我动态创建了一个输入类型BUTTON,现在我想在按钮点击事件上调用函数.我正在使用onClick();这个功能.在上面的代码中,所有工作正常,但del.onclick不能正常工作(用于生成演示警报)
我没有在这个程序中使用任何jquery代码,所以请不要使用任何jquery代码.
我只是想复制一个打开的工作表文件。我尝试了很多变化都没有成功。下面是一个例子。会重视任何帮助。谢谢你。
function copyDocs() {
var file = DriveApp.getFilesByName('My Income Statement');
file.makeCopy();
}
Run Code Online (Sandbox Code Playgroud) 例子:
\n\n我的清单是['tree'\xef\xbc\x8c'world'\xef\xbc\x8c'tre'\xef\xbc\x8c'worl']
我的字典是{'tre':'good','worl':nice}
我的脚本:
\n\ndef replace(list, dictionary):\n for i in list:\n for k in dictionary:\n list = list.replace(k, dictionary[k])\n return list\nprint replace(input_file,curaw_dict)\nRun Code Online (Sandbox Code Playgroud)\n\n但每次我收到的结果都是像\xef\xbc\x9a
\n\ngoode\nniced\ngood\nnice\nRun Code Online (Sandbox Code Playgroud)\n\n我怎样才能让它更准确\n让它像
\n\ntree\nworld\ngood\nnice\nRun Code Online (Sandbox Code Playgroud)\n\n多谢
\n