合體,因此我的文檔在這裏以下內容:如何谷歌應用程序腳本processForm,withSuccessHandler和withUserObject
https://developers.google.com/apps-script/html_service?hl=en#GoogleScriptAPI
而且好像我應該能夠使用processForm,withSuccessHandler和withUserObject在同一地方,但我目前無法實現。這裏有一個嘗試
<input name='submission'>
<input type='hidden' name='match' value ='<?= match?>'>
<input type='hidden' name='week' value ='<?= j?>'>
<input type='hidden' name='assignment' value ='<?= i?>'>
<input id='button' type='button' onclick='google.script.run.processForm(this.parentNode).withSuccessHandler(submissionReceived).withUserObject(this).getCurrentDate()'>
,但是這給了我下面的錯誤按鈕被點擊時:
無法讀取屬性「withSuccessHandler_m___」的未定義
下不工作:
谷歌。 script.run.withSuccessHandler(submissionReceived).processForm(this.parentNode)
但是我想「submissionReceived」函數n接收本地對象,以便我可以進行一些本地更改,以反映此特定按鈕(很多)已被點擊的事實。基本上,這種排序:
google.script.run.processForm(this.parentNode).withSuccessHandler(submissionReceived)
失敗,錯誤相同的「未定義的無法讀取屬性‘withSuccessHandler_m___’」,是否我是試圖將對象傳遞到submissionReceived
下面將運行:
google.script.run.withSuccessHandler(submissionReceived).withUserObject(本).processForm(this.parentNode)
,但傳遞給submissionReceived的單個參數是undefined
有關如何將這三個函數成功結合以便將對象傳遞到客戶端的任何想法按鈕點擊的JavaScript函數?