zoukankan      html  css  js  c++  java
  • Uncaught RangeError: Maximum call stack size exceeded

    环境: jquery+bootstrap+bootstrapValidator

    问题描述:有个form表单,一点击按钮提交,就会报如题错误。正常应该是去校验表单输入。

    解决:

    从日志分析来看,报错的起始位置发生在bootstrapValidator内,只要删除相关的代码,就不会报错。

    但是校验代码也是非常的简单,和在登陆页面没有差别,怎么会报错呢。

    校验代码:

    $('#formSchool').bootstrapValidator({
            message : '您的输入有误',
            fields : {
                schoolName : {
                    message : '学校名称不能为空',
                    validators : {
                        notEmpty : {
                            message : '学校名称不能为空'
                        }
                    }
                },
                province : {
                    message : '省分不能为空',
                    validators : {
                        notEmpty : {
                            message : '省分不能为空'
                        }
                    }
                },
                city : {
                    message : '城市不能为空',
                    validators : {
                        notEmpty : {
                            message : '城市不能为空'
                        }
                    }
                },
                activeTime : {
                    message : '生效时间不能为空',
                    validators : {
                        notEmpty : {
                            message : '生效时间不能为空'
                        }
                    }
                },
                expireTime : {
                    message : '失效时间不能为空',
                    validators : {
                        notEmpty : {
                            message : '失效时间不能为空'
                        }
                    }
                }
            }
        });

    查找网上资料得知,很有可能是form页面的html代码造成的。form页面我改用了普通table书写,而登陆页面用的是bootstrap样式。问题很可能就在这里。改用bootstrap后一切正常了。

  • 相关阅读:
    java.io.file
    连线小游戏
    发票类型区分的正则表达式(仅区分普票专票)
    mybatis: No enum constant org.apache.ibatis.type.JdbcType."VARCHAR"
    bootstrap inputfile 使用-上传,回显
    微积分极限中一例
    oracle 查看表结构语句
    redis无法连接
    项目配置shiro原缓存注解失效
    bug 找不到或无法加载主类main.java.*
  • 原文地址:https://www.cnblogs.com/huiy/p/9047637.html
Copyright © 2011-2022 走看看