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.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.