返回列表 發帖

code 39 java代碼問題

我有一個 java script 寫的 code39 產生碼,可能我不知道那裡用錯了圖片生成不出來


<div id="qrcode" style="width:120px; height:120px; margin-top:0px;"></div>
                <script>
                var qrElement = document.getElementById("barcode");
               
                JsBarcode(qrElement,'10604TC560358117156',
  
                {
                        width:        1,
                        height: 100,
                        quite: 0,
                        format: 'CODE39',
                        displayValue: 0,
                        font:'monospace',
                        textAlign: 'left',
                        fontSize: 11,
                        backgroundColor: '#FFFFFF',
                        lineColor:'#000000'
                });
               
qrElement.addEventListener("DOMSubtreeModified", function(){
 // fires once without the src set, then again with it set
 imageSourceURL = qrElement.getElementsByTagName("canvas").getAttribute("src");
 if (imageSourceURL) {
   //console.log(imageSourceURL);
   window.location.href = imageSourceURL;
 }
}, true);

document.addEventListener('DOMContentLoaded', function(){
 var elText = "12331232312332";
 qrcode.makeCode(elText);
});

document.write(qrElement);
                </script>
        </div>


完整檔案

返回列表 回復 發帖