JQUERY Plugin:barcode Barcode Plugin

Source: Internet
Author: User

1)query.barcode.js installation

As with other jquery plugins, you only need to import the jquery framework and jquery.barcode.js into the page.

<type= "Text/javascript"  src= "Jquery-1.3.2.min.js"> </script><type= "Text/javascript" src = "Jquery-barcode.js" ></ Script >

2)How to use Jquery.barcode.js

2.1) Define a DOM object as a container for barcode/two-D code

<id= "Bctarget"></div>

2.2) use JavaScript to call Jquery.barcode.js to draw barcodes/two-D codes

$ ("#bcTarget"). Barcode ("1234567890128", "ean13");

jquery Object extension Method Barcode parameter Description

barcode:function (datas, type, settings)

2 types of 1.datas parameters supported

    • String : The content of the barcode string to draw (depending on the type of barcode). If the barcode type can hold these characters, and there is no validation that is mandatory, the ISE of the string will be automatically calculated (original: If barcode type include it, the presence of the checksum is not mandatory, it Ise automatically recalculated)
    • Object

2.type (String): barcode Type

    • 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)

3.settings (object): barcode-style configuration

BarWidth (bar code), Barheight (container height), Showhri (whether barcode content is displayed), BgColor (background color), color (barcode color), fontSize (content font size), output (how to draw barcodes: CSS , Svg,bmp,canvas, note that Svg,bmp,canvas does not support IE, preferably not. )

Sample Code

<inputtype= "button"onclick= ' $ ("#bcTarget"). Barcode ("1234567890128","Ean13", {barwidth:2, barheight:30}); ' Value= "Ean13"><inputtype= "button"onclick= ' $ ("#bcTarget2"). Barcode ("1234567","Int25", {barwidth:2, barheight:30}); ' Value= "Int25">  <inputtype= "button"onclick= ' $ ("#bcTarget3"). Barcode ({code:"1234567", Crc:false}, "Int25", {barwidth:2, barheight:30}); ' Value= "Int25 without CRC">  

JQUERY Plugin:barcode Barcode Plugin

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.