I'm trying to convert JSON data into a QR code, so when a user scans it, the JSON data should be displayed. I've been using the jquery.qrcode.min.js library for this. Here's an example of the JSON data format:
{"id":"4444455551223","tableid":"2222221111111444","areacode":"A0010","catid":"QWAAD"}
p.s id,tableid,areacode,catid these are fetched dynamically from url parameter
e.g www.demo.com?id=4444455551223&tableid=2222221111111444&areacode=A0010&catid=QWAAD
However, the issue I'm facing is that when I scan the generated QR code with a mobile device, it only shows "4444455551223" as the result, rather than displaying the entire JSON data. Any ideas on how to solve this?
Code used to generate QR code.
jQuery('#output').qrcode( {
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const id = urlParams.get('id').toString();
const tableid = urlParams.get('tableid').toString();
const areacode = urlParams.get('areacode').toString();
const catid = urlParams.get('catid').toString();
var myJSON ={"id":"'+id+'","tableid":"'+tableid+'","areacode":"'+areacode+'","catid":"'+catid+"}';
// render method: 'canvas', 'image' or 'div'
//render: 'canvas',
// version range somewhere in 1 .. 40
minVersion: 1,
maxVersion: 40,
// error correction level: 'L', 'M', 'Q' or 'H'
ecLevel: 'Q',
// offset in pixel if drawn onto existing canvas
left: 0,
top: 0,
// size in pixel
size: 500,
// code color or image element
fill: '#000',
// corner radius relative to module width: 0.0 .. 0.5
radius: 0,
// quiet zone in modules
quiet: 0,
text: myJSON
} );
});