Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<html>
<head>
<script type="text/javascript" src="https://xxxxx/qrcode.js"></script>
</head>
<body>
%%[
set @data = 'http://sfmarketing.cloud/'
]%%
<div id="qrcode" style="width:300px; height:300px;"></div>
<span id="code"></span>
<script type="text/javascript">
var qrcode = new QRCode(document.getElementById("qrcode"), {
width : 300,
height : 300
});
function makeCode () {
var elText = "%%=v(@data)=%%";
qrcode.makeCode(elText);
}
makeCode();
setTimeout(function(){
var imgsrc = document.getElementById("qrcodesrc").src;
document.getElementById("code").innerHTML = imgsrc;
}, 500);
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment