Vote count:
0
I have a iframe in that, I do have 2 divs. one is editable(typeable) another one is not.
when something typed in editable element, i require to send the text to server. I am trying to hear from the event, but i not able to get anything.
but only the click event works!
i tried with promise approach too.. no luck. always i am getting the iframe body as target instead of getting the children(div) how to overcome with this issue?
here is my function:
$.when(iframebody.append(div).append(msgDiv)).done(function(output){
output.find('.mceEditable').on('click', function(e){
console.log("hi", $(e.target)); //works!
});
});
$.when(iframebody.append(div).append(msgDiv)).done(function(output){ output.find('.mceEditable').on('keyup', function(e){ console.log("hi", $(e.target)); // show the parent (body) }); });
html:
<body id="tinymce" class="mce-content-body " data-id="tinyeditor1" contenteditable="true" spellcheck="false">
<p><br data-mce-bogus="1"></p>
<div class="txtMsg mceNonEditable" data-mce-contenteditable="false" style="margin-bottom: 5px; background: rgb(242, 242, 242);">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan et viverra justo commodo. Proin sodales pulvinar tempor. Cum sociis natoque penatibus et magnis dis parturient montes, n</div>
<div class="msgText mceEditable" data-mce-contenteditable="true" style="margin-bottom: 5px; outline: 0px;">
<span class="nameInfo" style="display:none">XYZ - Says : </span> some</div>
</body>
asked 22 secs ago
only 'click' event works, how to add 'keyup' event
Aucun commentaire:
Enregistrer un commentaire