qrcodejs icon indicating copy to clipboard operation
qrcodejs copied to clipboard

Is there has a callback method when i scaned successfully?

Open huangche007 opened this issue 8 years ago • 3 comments

huangche007 avatar Dec 29 '17 08:12 huangche007

is there a callback function ? it sucks to just wait for it.

martianmartian avatar Mar 22 '18 11:03 martianmartian

i need it too

sourcenew avatar Aug 26 '19 08:08 sourcenew

A callback upon the image loading would be useful. Sure we can find the <img> tag created by qrcodejs and then set its onload callback, but once the image loads the first time this doesn't seem to work.

Edit: I think one could just set the image's src attribute to an empty string and then the onload event might fire once it's loaded again. Not sure.

Use the element's onload property or in jQuery the load event, which must be used with on: $('#elm').on('load', ()=>console.log('hi') );

justingolden21 avatar Jun 03 '20 05:06 justingolden21