Book Image

Kendo UI Cookbook

By : Sagar Ganatra
Book Image

Kendo UI Cookbook

By: Sagar Ganatra

Overview of this book

Table of Contents (18 chapters)
Kendo UI Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Generating a QR code image to represent a URL, e-mail, telephone, and geographic location


A Quick Response code (QR code) is generally used to efficiently store data by encoding it. It uses ISO_8859_1 as the encoding method by default to store data. The generated code consists of black modules (square dots) arranged in a square grid on a white background. This code can then be read by a camera and then processed by an application.

In this recipe, we will see how various forms of data such as URLs, e-mail addresses, telephone numbers, and geographic locations can be stored in a QR code.

How to do it…

To generate a QR code, invoke the kendoQRCode function on the DOM element:

$("#chart").kendoQRCode({
  value: 'http://www.kendoui.com'
});

In the previous example, the http://www.kendoui.com URL is specified. This value will be encoded using ISO_8859_1 and represented in a square grid. When you scan the QR code, the value stored in it is identified. Since the value is prefixed with the protocol name...