Skip to content

Commit

Permalink
Fixed pure javascript not working if jQuery is not used. Added pure j…
Browse files Browse the repository at this point in the history
…avascript to unit-test.html
  • Loading branch information
lindell committed Jan 21, 2016
1 parent ec70e3a commit 46cc973
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion JsBarcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,4 @@
};
}

})(jQuery);
})(typeof jQuery != 'undefined' ? jQuery : null);
18 changes: 18 additions & 0 deletions example/unit-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,23 @@
<img id="barcode10"/>
<script>$("#barcode10").JsBarcode("12345",{format:"pharmacode", width:1, displayValue: true});</script>
</div>

<div class="testbox">
<b>Format:</b> CODE128<br>
<b>Input:</b> Using querySelect<br>
<b>Extra:</b>
<br><br>
<img id="barcode11"/>
<script>JsBarcode("#barcode11","A little test!",{format:"CODE128", width:1, displayValue: true});</script>
</div>

<div class="testbox">
<b>Format:</b> CODE128<br>
<b>Input:</b> Using element<br>
<b>Extra:</b>
<br><br>
<img id="barcode12"/>
<script>JsBarcode(document.getElementById("barcode12"),"A little test!",{format:"CODE128", width:1, displayValue: true});</script>
</div>
</body>
</html>

0 comments on commit 46cc973

Please sign in to comment.