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 ...
随机推荐
- IOS怎么实现一个UITableView的下拉刷新
採用的EGORefreshTableHeaderView来实现: 在Controller上实现EGORefreshTableHeaderDelegate的delegate @property(nona ...
- Analyze提示:Value stored to "***"is never read
text这个变量没有被使用,在当前类中搜索'text'这个变量发现仅仅是被赋值并没有被使用. 提示意思是:删除或者凝视这行代码;
- Oracle,mysql,sqlserver,postgresql语句几点比較
1.分页 Oracle: SELECT * FROM(SELECT A.*, ROWNUM RN FROM (select T.* from sj_receiptinfo t WHERE t.TAXN ...
- iOS 手机没有安装支付宝的情况下,不调支付宝网页的解决的方法
NSArray *array = [[UIApplication sharedApplication] windows]; UIWindow* win=[array objectAtIndex:0]; ...
- singlefile.py
#! encoding=utf-8 import os import os.path AllFiles = {} MinSize = 8100 def OneDir( DirName ): if Di ...
- LeetCode241——Different Ways to Add Parentheses
Given a string of numbers and operators, return all possible results from computing all the differen ...
- FileZilla文件下载的目录
连接上ftp服务器之后,在remote site那边邮件选中了目录下载文件,但是下载完成之后. 不知道下载到哪里了,用search everything软件搜了一下,发现就在D盘的根目录. 所以,下载 ...
- system.web section group下的section
private Configuration _configuration; private ConfigurationSectionGroupCollection sectionGroups; pri ...
- 洛谷 P2055 [ ZJOI 2009 ] 假期的宿舍 —— 二分图匹配
题目:https://www.luogu.org/problemnew/show/P2055 二分图匹配: 注意要连边的话对方必须有床! 代码如下: #include<iostream> ...
- Mysql的事务、视图、索引、备份和恢复
事务 事务是作为单个逻辑工作单元执行的一系列操作,一个逻辑工作单元必须具备四个属性.即:原子性.一致性.隔离性.持久性,这些特性通常简称为ACID. 原子性(Atomicity) 事务是不可分割的 ...