简体   繁体   English

如何调试此 JavaScript 错误?

[英]How do I debug this JavaScript error?

I am working on a staging site , and the homepage slider isn't work.我正在一个临时站点上工作,主页 slider 不起作用。 I'm new to debugging JavaScript, how do I break down, with Firebug, or using the console, why the slider isn't working?我是调试 JavaScript 的新手,如何使用 Firebug 或使用控制台进行故障排除,为什么 slider 不起作用?

I've tried just about everything, and I've come up empty.我已经尝试了几乎所有东西,但我还是一无所获。 Hoping a pro can come in and help me through it, and that in turn will teach me for future debugs.希望专业人士可以进来帮助我完成它,而这反过来会教我未来的调试。

Thanks guys and gals!谢谢大家!

You can use the console.log function eg console.log("some debug info");您可以使用 console.log function 例如 console.log("some debug info"); to output informaiton such as variable states and see how far the code is executing.到 output 信息,例如变量状态,看看代码执行了多远。 You can view this output using Google Chrome Developer Tools ie click the tool icon at the top right and then Tools > Developer Tools or Cntrl + Shift + I.您可以使用 Google Chrome 开发人员工具查看此 output,即单击右上角的工具图标,然后单击工具 > 开发人员工具或 Cntrl + Shift + I。

This also works for Firefox's WebConsole (Cntrl + Shift + K).这也适用于 Firefox 的 WebConsole (Cntrl + Shift + K)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM