javascript - event.currentTarget.innerHTML is empty in IE10 after view is re-rendered -
here (check to see the difference in Chrome and IE10)
HTML
& lt; Body & gt; & Lt; Div id = 'a' & gt; & Lt; Button & gt; Click me & lt; / Button & gt; & Lt; / Div & gt; & Lt; / Body & gt;
JS
var markup = '& lt; Button & gt; Click me & lt; / Button & gt; '; $ ('#A') ('Click', 'button', function () {$ ('# a'). Html (markup);}); $ ('#A') ('Click', 'button', function (event) {console.log (event.currentTarget.innerHTML); //.....(1)});
Line (1) gives correct output in Chrome and Firefox, whereas in IE 10, I get empty string as the value of event.currentTarget.innerHTML
. This only occurs when div (# A)
is presented again.
PS: I am using backbone.js
in which I rewind the view but to simplify the question, I removed the picture from the back without any spinal cord Has refined.
I was curious so one had to go it would not answer your question, but pointing in the right direction
(1) In your example, you replace a button with a similar button, if you change it with a different text then you will see it in Chrome
(3) It works (of type)
(2) There is an empty button with a parent currentTarget
in IE
IE and Chrome If you do this:
event.delegateTarget.children [0]. Winner HTML
(4) There is no difference in the doctor type
Your answer is the representative target and current target, or just the representative target
Comments
Post a Comment