- Posted On 15 September 2014
- By
- In Programming
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.
- Tags :
- ASP.NET
- MVC
- jQueryJavascript
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.
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.
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.
How to select all checkboxes as per range of numbers in jQuery MVC
JQuery code to select all checkboxes as per range provided with select all and deselect all functionality which can be embedded in ASP.NET MVC too. With validations such as invalid range.