JsBarcode
JsBarcode copied to clipboard
more than 1 call to JsBarcode errors api.options(...)[options.format] is not a function
var upc=new Image()
new JsBarcode(
upc,
"796030114977",
{
format: "UPC",
width: 3,
height: 80,
}
)
var cno=new Image()
new JsBarcode(
cno,
"796030114977",
{
format: "UPC",
width: 3,
height: 80,
}
)
on the second call i get
runtime-core.esm-bundler.js?5c40:218 Uncaught TypeError: api.options(...)[options.format] is not a function
at JsBarcode (JsBarcode.js?62c5:76)
...
var upc=new Image()
JsBarcode(
upc,
"796030114977",
{
format: "UPC",
width: 3,
height: 80,
}
)
var bc=()=>{
var cno=new Image()
JsBarcode(
cno,
"796030114977",
{
format: "UPC",
width: 3,
height: 80,
}
)
};
bc()
does not throw the error