1.0.1 • Published 6 years ago
jquery-tcsc-convert v1.0.1
History
One way solution to convert text between Traditional Chinese and Simplified Chinese in browser. No any dependencies required.
Installation + Use
- Install the npm
npm install jquery-tcsc-convert --save
- Import the script tag after the jQuery
<!-- jQuery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!-- jQuery extension `jquery-tcsc-convert` -->
<!-- <script src="dist/js/jquery-tcsc-convert.js"></script> -->
<script src="dist/js/jquery-tcsc-convert.min.js"></script>
<script>
$(function () {
$('input').keyup(function ($event) {
console.log($event.originalEvent.key);
$('#tc-result').html(convertSC2TC($(this).val()));
$('#sc-result').html($.tc2sc($(this).val()));
});
});
</script>
Test
npm install -g lite-server
lite-server
License
MIT