Question

So I am building a simple form that is using the bootstrap. Bootstrap wants to reference https://code.jquery.com/jquery.js as its core jQuery. When I reference that my bootstrap works but not my masking. It baulks at

 $(".phone").mask is not a function

If i change the jQuery reference to ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js it works just fine. I need them both to run on the same library. Any thoughts on what is hanging up the filter? It works for the validation just not the masking. Thanks!

Test Page: http://iupui.edu/~ofapd/registration/indexDirect.php?id=1165

Was it helpful?

Solution

All rights. See in js/jquery.maskedinput.js:

 var pasteEventName = ($.browser.msie ? 'paste' : 'input') + ".mask";
 // TypeError: $.browser is undefined

See here jQuery Core 1.9 Upgrade Guide. Since 1.9 $.browser is removed. In first case https://code.jquery.com/jquery.js you loading 1.10 - it doesnt work. But in second 1.5 - its works. Read about migration and compatibility.

OTHER TIPS

The linked test site appears to be using an old version of jquery.maskedinput.js (1.2.2) which is not compatible with later versions of jQuery. Try the latest version (currently 1.3.1).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top