Answer the question
In order to leave comments, you need to log in
Why doesn't the 'paste' event work in IE?
The task as a whole: to insert a picture from the clipboard. The main problem that I have been sitting with for more than one hour is Internet Explorer, here is an example of code that does not work in IE... The insert event does not work, the solution did not work on google :(
Help, plzzzzzzz...
var el = document.getElementById('editor');
el.addEventListener('paste', function (e) {
console.log(123);
var clipboard = e.clipboardData;
if (clipboard && clipboard.types) {
var types = clipboard.types;
if (types.indexOf('public.url') > -1) {
// Останавливаем действие по умолчанию, чтобы не вставлялась картинка с фейковым урлом (webkit-fake-url://416873AC...)
e.preventDefault();
// Вставляем картинку
var img = new Image();
img.src = clipboard.getData('public.url');
el.appendChild(img);
}
}
});
Answer the question
In order to leave comments, you need to log in
Like sensible people did. https://ru.coursera.org/learn/c-plus-plus-white
C++ has been actively changing, so fresh books are preferable. But this does not mean that everything that has been written before is completely outdated.
I can recommend Meyers "Effective C++". But this is after you master the basic syntax.
https://developer.mozilla.org/en-US/docs/Web/Event...
And who said that this event is supported in IE?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question