CopyPastor

Detecting plagiarism made easy.

Score: 0.8221237063407898; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2017-05-26
by Arvind Audacious

Original Post

Original - Posted on 2016-10-29
by Walle Cyril



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Try this:
<!-- language: lang-js -->
let urlObject;
socket.onmessage = function(msg) { const arrayBuffer = msg.data; const image = document.getElementById('image');
if (urlObject) { URL.revokeObjectURL(urlObject) // only required if you do that multiple times } urlObject = URL.createObjectURL(new Blob([arrayBuffer]));
image.src = urlObject;
};

Another alternative
let urlObject;
socket.onmessage = function(msg) { const arrayBuffer = msg.data; const image = document.getElementById('image'); if (urlObject) { URL.revokeObjectURL(urlObject) // only required if you do that multiple times } urlObject = URL.createObjectURL(new Blob([arrayBuffer]));
image.src = urlObject;
};

        
Present in both answers; Present only in the new answer; Present only in the old answer;