JQuery masked input plugin does not work on IE7

北城以北 提交于 2019-12-23 13:09:07

问题


I'm using Jquery Masked input plugin http://digitalbush.com/projects/masked-input-plugin/

According to the changelog it should support IE7

When when trying to use it on IE7 It's does not work and I'm getting the following error in IE debugger

Object doesn't support property or method 'mask'

My code :

$("#" + "someid").mask(someformat);

The same code work on all other browsers including IE8 and above.


回答1:


For IE7 try to use version 1.2.2 of masked-input https://zk-sample-code.googlecode.com/svn-history/r27/trunk/WebContent/samples/sam/inputbox/js/jquery.maskedinput-1.2.2.js

$(function () {
   $("[name='in1']").mask("99/99/9999");
   $("[name='in2']").mask("99-99-99");  
});

example: http://jsfiddle.net/ishubin/aVwpn/




回答2:


Error in script jquery.maskedinput.js!

now:

$.mask = {
    //Predefined character definitions
    definitions: {
        '9': "[0-9]",
        'a': "[A-Za-z]",
        '*': "[A-Za-z0-9]"
    },
    dataName: "rawMaskFn",
    placeholder: '_',
};

need:

$.mask = {
    //Predefined character definitions
    definitions: {
        '9': "[0-9]",
        'a': "[A-Za-z]",
        '*': "[A-Za-z0-9]"
    },
    dataName: "rawMaskFn",
    placeholder: '_'
};

work on IE7!



来源:https://stackoverflow.com/questions/16008308/jquery-masked-input-plugin-does-not-work-on-ie7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!