【问题标题】:datepicker doesn't work in ie7 [closed]datepicker 在 ie7 中不起作用 [关闭]
【发布时间】:2010-10-17 19:58:16
【问题描述】:

我已经实现了一个 ui 日期选择器,它在 FF 中完美运行,但在 IE 中却不行。

请参阅此处link 尝试单击“Geboortedatum”字段。 怎么了?

【问题讨论】:

    标签: jquery datepicker


    【解决方案1】:

    这是你的问题:

        //set the rules for the field names
                rules: {
                    firstname: {
                        required: true,
                        minlength: 2
                    },
                    surname: {
                        required: true,
                        minlength: 2
                    },              
                    email:{
                        required: true,
                        email: true
                    },
                    password:{
                        required: true
                    }, <----- remove this comma !!!
    
                }, 
    

    删除上面的逗号。另外,如果您将该代码块放入http://jslint.com,您会发现同样的事情。正如其他人指出的那样,IE 不喜欢像散列那样的尾随逗号

    【讨论】:

    • +1 发现了好逗号,不错!
    【解决方案2】:

    Ladosa.js 中的第 76 - 78 行:

    password:{
      required: true,
    },
    

    应该是

    password:{
      required: true
    },
    

    至少这就是我的 IE 给出的错误。
    希望这可以帮助您朝着正确的方向前进。

    EDIT(第 78 行,也在 Ladosa.js 中)

    rules: { //begin rules tag
      ...
    
      password:{
        required: true
      }, // <--- remove this comma also!
    
    }, //end rules tag
    
    messages: {
        name: "Please enter your name",
        email: "Please enter a valid email address"
    },
    

    一定要检查所有开始标签是否都有结束标签,并且在删除函数中的代码时请务必删除所有内容...
    此外,如果您 INDENT(code laten inspringen)您的代码,则更容易发现错误。

    【讨论】:

    • 你怎么能看到第 79 行,我的视图源出于某种原因只显示到第 69 行
    • 我编辑了答案:它是 Ladosa.js 中的第 76-78 行。
    • 不...我的问题是查看源代码,当我在记事本中打开它时,最远的行是69,我不明白为什么
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-19
    • 2012-03-06
    • 1970-01-01
    • 2012-02-09
    • 2012-07-21
    相关资源
    最近更新 更多