Subscribe - It's FREE!!

Stay Connected Here

Stay Updated With Us Here



Google

How to generate barcode using jQuery (ean8, ean13, code11, code39, code128, codabar and more)


Share with WhatsApp


This post covers information about how you can create or generate barcode using jQuery.

jQuery barcode plugin is a simple and lightweight jQuery plugin authored by Demonte Jean-Baptiste and Hourez Jonathen ( BarCode Coder Library )and available for all under dual license (cecill and gnu)

Using this plugin is very simple. Let’s start step by step.

Plugin is a jQuery plugin so it’s obvious that you will required to include jQuery js to use this plugin. With jQuery you need to include plugin’s js file too like following.

<script src="http://code.jquery.com/jquery-latest.min.js"></script>

<script type="text/javascript" src="jquery-barcode.js"></script>

Once you include above js then you are ready to generate barcode.

You just need to call barocode function on the target div or input which takes parameters as string to generate barcode and barcode type like below.

$("#divtodisplay").barcode("stringtogenerate","code39");

That’s it. You will see a generated barcode in div.

This plugin supports multiple types which are listed below.

  • codabar
  • code11 (code 11)
  • code39 (code 39)
  • code93 (code 93)
  • code128 (code 128)
  • ean8 (ean 8)
  • ean13 (ean 13)
  • std25 (standard 2 of 5 - industrial 2 of 5)
  • int25 (interleaved 2 of 5)
  • msi
  • datamatrix (ASCII + extended)

Plugin is able to generate barcode in 4 output types which are as follows.

  • CSS
  • BMP (not works in IE)
  • SVG (not works in IE)
  • CANVAS (works only with canvas supported browsers)

Below is the live fiddle showing usage of this plugin.

Hope you have benefitted from this post. Try this plugin and do share your thoughts. Also if you are having something to add this post positively do share that too. Thanks.

To know more about this plugin you can visit its official site here.



If you enjoyed this post take 5 seconds to share it! Be Socialable. :-)

Share with WhatsApp

Posts To Read Next

Top 10 Visual Studio things which can boost developers coding speed

Visual Studio 2012 provides some coding features by which you can code faster if use them properly. This post will cover top 10 things among them to boost your development speed.


Visual Studio 2008 Shell and TFS integration

Visual Studio 2008 Shell and TFS integration is the problem for all newbies of BIDS and TFS. Here is the solution.


How to call click or any event only once in jQuery

Know how to execute an click event or any event only once for any element in jQuery. Perform action only once and even not required to unbind event.


Assembla - Free and private repository to manage your source code online with SVN subversion hosting

With Assembla you can share source code with others online. Free & Private source code repository with SVN Subversion, Git & Perforce Hosting.


Speed up coding in Visual Studio with code snippets & samples at your fingertips

Know how you can speed up coding in Visual Studio with Bing Developer Assistant by having millions of code snippets and sample projects at fingertips.


Your opinion is valuable for us! Comments, suggetions are welcome.


Submit your Email Id to stay updated with us and get notified with our new posts. It's FREE!
We know this popup is disturbing you!
But We would greatly appreciate if you share us with your friends below!

It will not take more than 2 seconds but will motivate us greatly to write more,share more!

x