onload

window.onload

執行單一函式

window.onload = initial; //頁面載入時呼叫function initial()

執行多個函式

window.onload = function(){

    Func1();

    Func2();

    Func3();

    .....

}

呼叫GAS後端程式:參考文獻 https://developers.google.com/apps-script/guides/html/reference/run?hl=zh-tw

withFailureHandler(function) 

withSuccessHandler(function) 

withUserObject(object) 

方法一:無回傳值

google.script.run.doSomething();

方法二:返回之後接收回傳值、執行其他指令

google.script.run.withSuccessHandler( function(回傳值){

返回後執行的指令

} ).GAS函數名稱(傳入參數);

方法三:返回之後執行指定函式名稱、回傳值在函式內接收

google.script.run.withSuccessHandler( 函式名稱 ).GAS函數名稱(傳入參數);

function 函數名稱(回傳值){

返回後執行的指令

}

改變文字顏色

document.getElementById("label").style.color = "red";

改變文字大小

document.getElementById("label").style.fontSize = "36px";

改變文字字型

document.getElementById("label").style.fontFamily = "36px";

偵測字串內是否包含子字串

var str = "";

var subString = "";

str.includes(subString); //存在回傳true,字母大小寫視為不同。