Debugging client side code from Google Apps Script

五迷三道 提交于 2020-12-29 10:12:35

问题


I have issues with my client-side code (who doesn't, with any code they write in any language, at one point or another in the development process?) Problem is that I'm writing this code in Google Apps Script, and can't find the js code I am trying to debug/examine for errors. I remember being able to enter a function name, and then click on the returned code to go straight to the code file, and the function in it, but that, for some reason, isn't working here. I try it and this is what I get taken to:

(I think Caja might have something to do with this...)

I think it's in some VM**** file, but I don't know much about that. How to access that JavaScript code to set some breakpoints?!


回答1:


From answer to how can I debug client side javascript (in html pages) in google appscripts

Unfortunately, there is no other good way to debug client side web UI other than with console logs. As you noted the JavaScript/DOM is re-written so you can't use standard Chrome debug tools.

Because of the above, consider using the approach suggested by Mogsdad on Did you know? (You can log to a spreadsheet from client JavaScript!): Write debugging logs to a spreadsheet.




回答2:


what about 'debugger'?Write it in the code



来源:https://stackoverflow.com/questions/46520959/debugging-client-side-code-from-google-apps-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!