Skip to content

Instantly share code, notes, and snippets.

@lvbreda
Created June 17, 2012 11:32
Show Gist options
  • Save lvbreda/2944278 to your computer and use it in GitHub Desktop.
Save lvbreda/2944278 to your computer and use it in GitHub Desktop.
QrCode
<head>
<title>qrcode</title>
</head>
<body>
{{> qrcode}}
{{> image}}
</body>
<template name="qrcode">
<h2>QR CODE</h2>
<input type="text" name="code" id="code" value="Enter data here..." />
<input type="button" class="gen" value="Generate">
</template>
<template name="image">
<img src="http://chart.apis.google.com/chart?cht=qr&chs=500x500&choe=UTF-8&chld=H&chl={{content}}">
</template>
if (Meteor.is_client) {
Template.qrcode.events = {
'click input.gen': function () {
Session.set("data", code.value);
}
};
Template.image.content = function(){
return Session.get("data");
};
}
if (Meteor.is_server) {
Meteor.startup(function () {
// code to run on server at startup
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment