问题
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