Jump to content

Getting Dynamic Qr Code Generation To Work On A Blogger Blog


Recommended Posts

Dang I cant copy and paste your code to edit it.

<img height='240' width='240' id='qrimage' />


<script type='text/javascript'>
 document.getElementById('qrimage').src='***enter new image src here***';
</script>

I don't fully understand what your trying to do but unless the src ends .jpg, .png, gif .... etc you wont get an image.

Edited by buffy
Link to comment
Share on other sites

Dang I cant copy and paste your code to edit it.

<img height='240' width='240' id='qrimage' />


<script type='text/javascript'>
 document.getElementById('qrimage').src='***enter new image src here***';
</script>

I don't fully understand what your trying to do but unless the src ends .jpg, .png, gif .... etc you wont get an image.

When used on your site, it grabs the URL its placed on, then adds it to the string. Then google spits out a QR code image that when scanned with a phone with the QR plugin, it will load the websites address or whatever text info is in the QR code message.

If you need to make one, try http://createqrcode.appspot.com/

And an image does not have to end in jpg, png or gif to display properly. For example - http://chart.apis.google.com/chart?cht=qr&chs=300x300&chl=Hello%20World&chld=H|0 is an image, just can't post it here because the forums don't allow extraneous code in the image url for security reasons.

by the way, the code in the first post, has the image tag inside of the script. You need to reference the script in the image tag as a src="javascript:somescriptThingy();" and then in the script, have it change the image for you on the fly.

Edited by digip
Link to comment
Share on other sites

by the way, the code in the first post, has the image tag inside of the script. You need to reference the script in the image tag as a src="javascript:somescriptThingy();" and then in the script, have it change the image for you on the fly.

So the updated code would be? Sorry, like I said I don't know a lot of html beyond basic tags. I got this code from 1 of the various blog posts on it if you do some Googling. The original post I had found was for getting it to work on a WordPress blog (which Lifehacker pointed out recently), but seeing as this is using Google's service I thought it would be easy enough to implement into a Blogger blog... but nope, it doesn't display anything right now.

BTW, heres the code in text form:

<script type='text/javascript'>

<img height="240" id="QRImage" width="240" />

$("#QRImage").attr("src", "http://chart.apis.google.com/chart?cht=qr&chl=" + location.href + "&chs=240x240");

</script>

Edited by JustinW
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...