[英]Debugging client side code from Google Apps Script
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.我的客户端代码有问题(谁没有,他们在开发过程中的某个时间点或其他时间用任何语言编写的任何代码?)问题是我在 Google Apps Script 中编写此代码,并且找不到我正在尝试调试/检查错误的 js 代码。 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...) (我想 Caja 可能与此有关...)
I think it's in some VM**** file, but I don't know much about that.我认为它在某个 VM**** 文件中,但我对此知之甚少。 How to access that JavaScript code to set some breakpoints?!
如何访问该 JavaScript 代码以设置一些断点?!
From answer to how can I debug client side javascript (in html pages) in google appscripts从回答到如何在 google appscripts 中调试客户端 javascript(在 html 页面中)
Unfortunately, there is no other good way to debug client side web UI other than with console logs.
不幸的是,除了使用控制台日志之外,没有其他好的方法来调试客户端 Web UI。 As you noted the JavaScript/DOM is re-written so you can't use standard Chrome debug tools.
正如您所指出的,JavaScript/DOM 已重新编写,因此您无法使用标准的 Chrome 调试工具。
Because of the above, consider using the approach suggested by Mogsdad on Did you know?由于上述原因,请考虑使用 Mogsdad 在您知道吗? (You can log to a spreadsheet from client JavaScript!) : Write debugging logs to a spreadsheet.
(您可以从客户端 JavaScript 记录到电子表格!) :将调试日志写入电子表格。
'debugger' 怎么样?写在代码里
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.