Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome breakpoint on radio doesn't fire

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. enter image description here

like image 890
chx Avatar asked Nov 19 '25 09:11

chx


1 Answers

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

enter image description here

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.

like image 91
chx Avatar answered Nov 21 '25 23:11

chx



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!