QR Codes can do a lot – Share website URLs between phones

share URL via QRCoder

Ever got stuck just before sharing a URL to your phone while reading it on your PC or even on a friend’s phone? Well that’s a common issue with a lot of users as to just sharing a simple URL you need to get into thinking what should you do now. And that even sometimes troubles me a lot.

Even though I am as well a software developer and have got various tricks to get around such a problems to facilitate myself, this trick of JavaScript is really a useful addition in my list. Remember “Faisal”? a mobile developer from Pakistan who has been featured a couple of times for his apps and games on techprolonged. He messaged me over the twitter this morning to let me know about this quick trick to get over with the sharing issues of simple text or URLs between mobile devices.

Wait! don’t think about copying text or URL and sending it over SMS or Email or anything like that e.g. bluetooth etc. etc. Just stop thinking about that. That’s really a waste of time, I never did that. You really want to know what Faisal has brought to you. This is the JavaScript code that simple interacts with Google’s QR Code API to generate a QR code of the URL that you are currently reading on. So how will it work? Simply go as follows.

Pick up the following code. (You will need to select and copy it.)

javascript:(function(){function QRCoder(){var u=window,t=document,n=t.createElement("div"),r=t.createElement("img"),i;r.src="https://chart.googleapis.com/chart?chs=200x200&cht=qr&chl="+window.location,n.id="QRCoder",n.style.padding="60px",n.style.border="1px solid #f00",n.style.textAlign="center",n.style.backgroundColor="#ccc",n.onclick=function(){t.body.removeChild(t.getElementById("QRCoder"))},i=t.createElement("div"),i.style.fontFamily="tahoma",i.innerHTML="tap to hide",n.appendChild(r),n.appendChild(i),n.style.zIndex=6999,n.style.position="fixed",n.style.top="10px",n.style.left=u.innerWidth/2-130+"px",t.body.appendChild(n)}QRCoder();})()
  1. Select and copy the above code and create a bookmark in your browser. You can do it in any browser on your PC or on your smartphone by going to the bookmarks or favorites manager in your browser. (Placing the bookmark in quick toolbar is good idea e.g. under the address bar in PCs)
  2. That’s actually it and it’s ready to be used. If this is your favorite web page and you want to share this page to your smartphone in seconds. Just click the bookmark you have created above and wait for a QR code appear right in a popup layer.
  3. Pickup your phone where you want to move this URL. Open up a QR code reader and point that on this QR code. There you go.
If you need any help, a video demo is there for you.

 

 

You really need to appreciate it. Thank you Faisal for such a quick fix to a very common problem.

 
[source]