I have a page which loads a lot of JavaScript files. Somewhere in the files, an onchange handler is added to an inputfield A.
When a value is added into inputfield A, inputfield B is automatically filled in with another value (depending on the value of A).
The sheer number of files and the names of the inputfields ('code', 'key') make it hard to use grep to find where the onchange is defined.
I've tried using
- Opera Dragonfly
- Firefox Firebug
- Google Chrome Developer Tools
but I can't seem to find out how to get them to show me where I can find the onchange function that gets called.
Anyone got an idea?
I have a page which loads a lot of JavaScript files. Somewhere in the files, an onchange handler is added to an inputfield A.
When a value is added into inputfield A, inputfield B is automatically filled in with another value (depending on the value of A).
The sheer number of files and the names of the inputfields ('code', 'key') make it hard to use grep to find where the onchange is defined.
I've tried using
- Opera Dragonfly
- Firefox Firebug
- Google Chrome Developer Tools
but I can't seem to find out how to get them to show me where I can find the onchange function that gets called.
Anyone got an idea?
Share Improve this question asked May 18, 2011 at 13:06 KonerakKonerak 39.8k12 gold badges101 silver badges121 bronze badges 2- 1 Do you know that something is assigning to the 'onchange' property: it may be using addEventListener or equivalent (which is a much more flexible interface for setting event handlers, but bypasses the "onxxx" properties) – Colin Fine Commented May 18, 2011 at 13:17
- That is possible too - can you include how to find these too in your answer? :) – Konerak Commented May 18, 2011 at 13:43
5 Answers
Reset to default 1you can see the jquery expression in firebug DOM inspector using firequery in firefox https://addons.mozilla/en-us/firefox/addon/firequery/
Chrome has build in developer tools that allow you to inspect an element and see any event listeners attached to it.
Google chrome developer tools really are amazing. http://code.google./chrome/devtools/docs/elements.html
You can use Firebug to set a breakpoint when a particular HTML element has an attribute change:
http://getfirebug./doc/breakpoints/demo.html#html
You could try selecting the second element you've described (that gets filled in) and see if that works for you.
Visual Events allows you to inspect the bound events without editing your code:
http://www.sprymedia.co.uk/article/Visual+Event
I had the same issue and I used Google Chrome's dev tool and it helped. Follow the steps below:
Select the event listener breakpoint
Select control checkbox
Select
onChange
this will pause on theonChange
function in your code
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744846843a4596890.html
评论列表(0条)