最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - JQuery masked input plugin does not work on IE7 - Stack Overflow

programmeradmin2浏览0评论

I'm using Jquery 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.

I'm using Jquery Masked input plugin http://digitalbush./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.

Share Improve this question asked Apr 15, 2013 at 5:39 john Smithjohn Smith 1,6058 gold badges37 silver badges54 bronze badges 8
  • what version of jQuery you are using? – Jai Commented Apr 15, 2013 at 5:42
  • @john Smith. can you post the HTML too? – arjuncc Commented Apr 15, 2013 at 5:42
  • @Jai - Jquery version 1.3.2 – john Smith Commented Apr 15, 2013 at 5:49
  • @Arjuncc - the input tag - <input name="someid" class="someclass" id="someid" type="text" size="30" maxLength="255" value="somevalue"/> – john Smith Commented Apr 15, 2013 at 5:49
  • @john have you tried with latest jQuery 1.9+? 1.3 is quite older one. – Jai Commented Apr 15, 2013 at 5:51
 |  Show 3 more ments

2 Answers 2

Reset to default 3

For IE7 try to use version 1.2.2 of masked-input https://zk-sample-code.googlecode./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/ishubin/aVwpn/

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!

发布评论

评论列表(0)

  1. 暂无评论