Uncaught TypeError: str.replace is not a function
在做审核页面时,点击审核通过按钮不执行
后来F12控制台查看发现有报错

是因为flisnullandxyzero未执行
然后找出这个方法,此方法为公共方法,将这个方法复制出来
然后使用console.log 输出找错误
发现方法执行到
if(Number(str.replace(".","")) < 0)时停止
整体方法----------------------------
function flisnullandxyzero(str) {
console.log(str);
if(null==str||( undefined==str)||(""==str)){
return true;
}else{
console.log(Number(str));
if(Number(str.replace(".","")) < 0){
return true;
}else {
return false;
}
}
}
修改之后---------------------------
function flisnullandxyzero(str) {
if(null==str||( undefined==str)||(""==str)){
return true;
}else{
if(Number(str) < 0){
return true;
}else {
return false;
}
}
}
总结
前端页面报错的时候,多用
console.log();调试
Uncaught TypeError: str.replace is not a function的更多相关文章
- jquery.js 3.0报错, Uncaught TypeError: url.indexOf is not a function
转载自:http://majing.io/questions/432 问题描述 jQuery升级到3.0.0后类型错误 jquery.js:9612 Uncaught TypeError: url ...
- Uncaught TypeError: (intermediate value)(...) is not a function 上一个方法结束没有加分号; 代码解析报错
Uncaught TypeError: (intermediate value)(...) is not a function 别忽略了, 第一个方法后面的结束 分号; 不起眼的,引来麻烦, 哎,规 ...
- jquery3.1.1报错Uncaught TypeError: a.indexOf is not a function
jquery3.1.1报错Uncaught TypeError: a.indexOf is not a function 使用1.9就没有问题,解决办法: 就是把写的代码中: $(window).lo ...
- 使用zepto中animate报错“Uncaught TypeError: this.bind is not a function”的解决办法
在使用zepto时,我先引入zepto.min.js,然后引入fx.js,但是在使用animate函数时,控制台却报如下错误: Uncaught TypeError: this.bind is not ...
- jQuery3.0+报错Uncaught TypeError: e.indexOf is not a function
jQuery3.0+报错Uncaught TypeError: e.indexOf is not a function 使用.load()绑定事件时报错,Uncaught TypeError: e.i ...
- 简记webpack运行报错 Uncaught TypeError: self.postMessage is not a function
说好2017Fix的还是能重现,可能项目的版本比较旧了,简要记录解决办法 1.错误: index.js?bed3:67 Uncaught TypeError: self.postMessage is ...
- jQuery报错:Uncaught TypeError: _this.attr is not a function
问题:想通过延时把置灰的按钮再次复原,代码如下: $("#sendEmailCode").on("click", function() { var _this ...
- vue项目报错1 Vue is a constructor and should be called with the `new` keyword && jquery.js?eedf:3850 Uncaught TypeError: this._init is not a function...
Vue is a constructor and should be called with the `new` keyword Uncaught TypeError: this._init is n ...
- Uncaught TypeError: window.showModalDialog is not a function
if(window.showModalDialog == undefined){ window.showModalDialog = function(url,mixedVar,features){ w ...
随机推荐
- 使用系统存储过程来监控SQLServer进程和会话具体解释
承接上文,本文讲述怎样使用系统存储过程来监控系统. SQLServer相同也提供了一系列系统存储过程用于监控SQLServer,获取当前进程.会话.请求以及锁定的具体信息.本文将演示系统存储过程 ...
- MyBatis 中#{}与${}绑定参数的区别
MyBatis 中#{}与${}绑定参数的区别: #{}将传入的数据都当成一个字符串,会对自动传入的数据加一个双引号.如:order by #{id},如果传入的值是111,那么解析成sql时的值为o ...
- C++中的继承与虚函数各种概念
虚继承与一般继承 虚继承和一般的继承不同,一般的继承,在目前大多数的C++编译器实现的对象模型中,派生类对象会直接包含基类对象的字段.而虚继承的情况,派生类对象不会直接包含基类对象的字段,而是通过一个 ...
- EF TMD
TMD 几个月前,本着学习的心态,首次在项目中应用EF.因为这里老是赶.赶.赶,当时只是匆匆而就,浅尝辄止,搞到现在对EF一知半解,每次在新项目使用,都担惊受怕,大费周折,不知道什么时候,在什么地方就 ...
- ios14--购物车优化2
// // ViewController.m // 03-综合练习 // // Created by xiaomage on 15/12/28. // Copyright © 2015年 小码哥. A ...
- AngularJS 1.x 国际化——Angular-translate例子
可运行代码如下: <!DOCTYPE html> <html ng-app="MyApp"> <head> <meta http-equi ...
- oracle查询时间段
select count(*) tt from crm_cisco_call_detailwhere DateTime between to_date('2016-4-5 00:00:00','yyy ...
- hibernate字段名和属性
字段名和属性名相同 Annotation:默认为@Basic 注意:如果在成员属性没有加入任何注解,则默认在前面加入了@Basic Xml中不用写column 字段名和属性名不同 Annotation ...
- [App Store Connect帮助]二、 添加、编辑和删除用户(3)添加和编辑用户
您可以在“用户和访问”中添加和编辑用户. 如果您以个人名义在“Apple 开发者计划”注册,您可以授权用户访问您 App Store Connect 中的内容.所有用户只拥有 App Store Co ...
- notepad + +使用步骤
原文地址:https://blog.csdn.net/so_geili/article/details/79317001#一-安装notepad 一. 安装notepad + + notepad+ ...