libphonenumber is quite the confusing tool to figure out considering the plethora of implementations and examples found all over the web, so please bear with me.
I'm simlpy trying to use this package like I've used every other JavaScript library like jQuery, via a script tag in an HTML file.
I've compiled libphonenumber using Google's compose tool, via the instructions here
So with this single file, I'm trying to use it as below. However, no matter what I've tried I simply can't seem to access any of the methods within.
<script type="text/javascript" language="javascript" src="/static/js/libphonenumber.js"></script>
<script type="text/javascript">
$(".phone-format").keyup(function () {
// Don't reformat backspace/delete so correcting mistakes is easier
if (event.keyCode != 46 && event.keyCode != 8) {
var val_old = $(this).val();
var newString = new libphonenumber.i18n.phonenumbers.AsYouTypeFormatter('US').input(val_old);
$(this).focus().val('').val(newString);
}
});
</script>
Is this usage scenario not at all supported?