In doing dynamically generated two-dimensional code uses dynamically generated images need to be downloaded to generate any file on a local, not on the server, only the page showing pictures downloaded to the local.
code show as below:
1 // download dimensional code 2 function downloadIamge () { . 3 var (IMG tag ID of the parent element) imgs = document.getElementById .getElementsByTagName ( "IMG" ); . 4 var A = document.createElement ( 'A' ); . 5 = a.download 'XDS' + new new a Date () the getTime () || 'Photo name';. // here is the file name, you can be customized . 6 a.href imgs = [0 ] .src; . 7 document. body.appendChild (A); . 8 a.click (); . 9 document.body.removeChild (A); 10 }