无线电广播中的Chrome断点不会触发 [英] Chrome breakpoint on radio doesn't fire

查看:115
本文介绍了无线电广播中的Chrome断点不会触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面,其中一些JavaScript修改了一个单选按钮不被检查,另一个被检查 - HTML源代码包含正确的检查属性,但是在检查时检查了错误的属性。另外,当关闭JS加载时,正确的一个被检查。因此,我在两个属性修改上都放置了一个Chrome断点,并且在重新加载时不会触发断点。我试图设置一个共同的父div的断点,它仍然不会触发。

解决方案

Phil的评论很有帮助,但它只需要一个一点爱。首先,选中Async复选框

< img src =https://i.stack.imgur.com/FUP60.pngalt =在这里输入图片描述>



在来源选项卡旁边的调用堆栈。否则,您将无法获得有用的调用堆栈。然后添加以下代码片段:

 < script> 
var debugel = document.getElementById(edit-field-slideshow-media-type-und-images);
Object.observe(debugel,function(changes){
console.log(changes);
debugger;
});
< / script>

在控制台和调试器之间,你有一个合理的机会来弄清楚会发生什么。


I have a page where some JavaScript modifies a radio button to be not checked and another to be checked -- the HTML source contains the right checked attributes but when inspecting, the wrong one is checked. Also, when loading with JS off, the right one is checked. So I put a Chrome breakpoint on both for attribute modification and the breakpoints do not fire when reloading. I tried to set a breakpoint on a common parent div and it still doesn't fire.

解决方案

Phil's comment is helpful but it needs just a little love. First, check the Async checkbox

in the Sources tab just next to the Call Stack. Otherwise you won't get a useful call stack. Then add this snippet:

<script>
var debugel  = document.getElementById("edit-field-slideshow-media-type-und-images");
Object.observe(debugel, function(changes) {
  console.log(changes);
  debugger;
});
</script>

Between the console and the debugger you have a reasonable chance to figure out what happens.

这篇关于无线电广播中的Chrome断点不会触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆