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 ...
随机推荐
- 异常:”未处理System.TypeLoadException“
1.问题由来: 在敲系统时原来的已有的类都能正常的执行,可是当加入一个新的实体类CancelCard的时候系统执行时显示错误例如以下: watermark/2/text/aHR0cDovL2J ...
- 在net中json序列化与反序列化 面向对象六大原则 (第一篇) 一步一步带你了解linq to Object 10分钟浅谈泛型协变与逆变
在net中json序列化与反序列化 准备好饮料,我们一起来玩玩JSON,什么是Json:一种数据表示形式,JSON:JavaScript Object Notation对象表示法 Json语法规则 ...
- JBoss AS 7之简单安装(The Return Of The King)
1.3 JBoss As 7安装 安装JBoss As 7分为以下几个步骤: 1. 下载JBoss 下载地址: <span style="font-size:18px;&quo ...
- Python学习笔记9:标准库之日期时间(time包,datetime包)
一 time包 sleep([float time]) 延迟一段以浮点数表示的秒数 time包基于C语言的库函数(library functions). Python的解释器一般是用C编写的,Pyth ...
- Android studio一些设置项
------Appearance选项------------------------------------------------------------- Cylic scrolling in l ...
- 'IOKING' TCP Transmission Server Engine ('云猴'©TCP通讯server引擎)(预告版)
关键词: IOKING IOCP TCP Transmission Server Engine Lock Free Interlocked 云猴完毕portTCP通讯server引擎 无锁 原子锁( ...
- Fiddler抓取https请求,解决“证书错误”警告
要抓取走HTTPS内容,Fiddler必须解密HTTPS流量. 但是,浏览器将会检查数字证书,并发现会话遭到窃听.为了骗过浏览 器,Fiddler通过使用另一个数字证书重新加密HTTPS流量. Fid ...
- POJ1061 青蛙的约会 exgcd
这个题虽然很简单,但是有一个比较坑的地方,就是gcd不一定是1,有可能是别的数.所以不能return 1,而是return a; 题干: Description 两只青蛙在网上相识了,它们聊得很开心, ...
- tyvj2054 四叶草魔杖——连通块 & 状压DP
题目:http://www.joyoi.cn/problem/tyvj-2054 把点分成几个连通块,和为0的几个点放在一块,在块内跑最小生成树作为这个块的代价: 然后状压DP,组成全集的最小代价就是 ...
- 65. ExtJs获取文本框中值的几种方式
转自:https://blog.csdn.net/qiu512300471/article/details/17415675/ 1.Html文本框 如:<input type=" ...