A QR code generator is an application that stores any required textual data into a QR code which can be later scanned with a QR code scanner to reveal the stored information. This QR Code can be used anywhere, for example, on a poster or website to allow users to get additional information. This application will allow the user to type in the data required and save it a PNG or SVG image of the QR code.
Approach: To generate the QR code, we will use the Google Charts API. Using jQuery, the QR code image to be displayed is updated according to the image returned by the API.
The API endpoint that would be used is given below.
Explanation of the URL:
- The root URL for Google Chart Infographics is https://chart.googleapis.com/chart. This can be specified with the required parameters to ger the desired output.
- The chs parameter denotes the size of the QR code image in pixels.
- The cht parameter denotes the type of the image to be created. The value “qr” will be used to generate a QR Code.
- The chl parameter denotes the text or URL data to be encoded in the QR code.
- How to create responsive image gallery using HTML, CSS, jQuery and Bootstrap?
- How to create followspot effect using HTML CSS and jQuery ?
- Creating Socket.IO Server using Express Generator
- PHP | FPDF-PDF Generator
- Node.js | crypto.createDiffieHellman(primeLength, generator) Method
- Node.js | crypto.createDiffieHellman(prime, primeEncoding, generator, generatorEncoding) Method
- How to load jQuery code after loading the page?
- JQuery | Setting background-image using CSS property
- Get the numeric part of CSS property using jQuery
- How to check an element has certain CSS style using jQuery ?
- How to change Input characters to Upper Case while typing using CSS/jQuery ?
- How to create a CSS rule or class at runtime using jQuery ?
- How to select all elements that contains some specific CSS property using jQuery ?
- How to get all CSS styles associated with an element using jQuery ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.