I'm using goqr.me api to create qrcode images. Now I want to create a download link for qrcode image.
I'm creating qrcode image this way:
function generateQrcode(data) {
var params = {
data: data,
size: '200x200',
margin: 0
};
// populate the preview box with the generate qrcode
var dwnldUrl = 'https://api.qrserver.com/v1/create-qr-code/?'+$.param(params);
previewBox.html('<img src="'+dwnldUrl+'" alt="qrcode-image"/>');
}
I want to have a download button for the qrcode image like this:
$('#qrcode-dwnld-btn').click(function() {
// something to trigger download for the image ....
}
Or is there anyother cross-browsing solution for this ?
Thanks for help.