Skip to content

Instantly share code, notes, and snippets.

@torifat
Last active June 19, 2020 18:02
Show Gist options
  • Save torifat/1352167 to your computer and use it in GitHub Desktop.
Save torifat/1352167 to your computer and use it in GitHub Desktop.
Enable Avro Phonetic in all textboxes & textareas with a callback function
<script src="path/to/avro-x.x.x.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(function(){
$('textarea, input[type=text]').avro({'bangla':true},
function(isBangla){
alert('Bangla enabled = ' + isBangla);
}
);
});
</script>
@mizan4392
Copy link

cann't add avro to react app

TypeError: jquery__WEBPACK_IMPORTED_MODULE_3___default(...)(...).avro is not a function

import React, { useEffect } from 'react';
import logo from './logo.svg';
import './App.css';
import $ from 'jquery'

function App() {

function handleBangla(e){
e.preventDefault()

    $(function(){
  $('textarea, input[type=text]').avro();
});

}
return (


<button onClick={(e)=>handleBangla(e)}>enable Bangla


);
}

export default App;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment