Skip to content

Instantly share code, notes, and snippets.

@zuzannamj
Created March 22, 2022 12:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zuzannamj/9a149a23d974af85ceb8a1ee1e03d861 to your computer and use it in GitHub Desktop.
Save zuzannamj/9a149a23d974af85ceb8a1ee1e03d861 to your computer and use it in GitHub Desktop.
<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