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 ...
随机推荐
- HDU 5305 Friends(简单DFS)
Friends Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Su ...
- Oracle 简单的列转行
需求是,统计每一个部门不同工种的薪水总和. SQL> select deptno,ename,job,sal from emp; DEPTNO ENAME JOB ...
- LeetCode 961. N-Repeated Element in Size 2N Array (重复 N 次的元素)
题目标签:HashMap 题目给了我们一个size 为 2N 的int array,其中有 N + 1 个唯一的 数字,让我们找出那个重复的数字. 利用hashset,把每一个数字存入,一旦发现有重复 ...
- LeetCode 160. Intersection of Two Linked Lists (两个链表的交点)
Write a program to find the node at which the intersection of two singly linked lists begins. For ex ...
- zoj 1610 Count the Colors 【区间覆盖 求染色段】
Count the Colors Time Limit: 2 Seconds Memory Limit: 65536 KB Painting some colored segments on ...
- const与static类成员
const成员函数作用1. 不能修改类的成员变量,同时不能调用类的非const成员函数.(const成员函数中,this的类型是一个指向const类类型对象的const指针,const成员函数返回*t ...
- js字符转处理
那几个函数的应用: <script> //全局变量删不掉,而全局属性能删掉 var a=123; function aa () { b=321; delete b; } aa(); del ...
- 树的遍历 迭代算法——思路:初始化stack,pop stack利用pop的node,push new node to stack,可以考虑迭代一颗树 因为后序遍历最后还要要访问根结点一次,所以要访问根结点两次是难点
144. Binary Tree Preorder Traversal Given a binary tree, return the preorder traversal of its nodes' ...
- PCB genesis短槽加引导孔实现方法
一.何为短槽 短槽通常定义:槽长小于2倍槽宽 如:槽长1.8mm,槽宽1.0mm 二.为什么要加短槽加引孔呢 短槽孔在钻孔时孔易偏斜导致槽长偏短, 当槽长宽比越小,则受力越不均匀,在钻第2个 ...
- PCB Winform使用谷歌webkit内核 应用
我们Winfrom界面嵌入网页最常用的是WebBrowser控件,因为微软自带的,使用方便,但在实际使用起来,会遇到各种麻烦(JS,不兼容问题,渲染等问题) 而实际WebBrowser控件内核是微软的 ...