当前位置:网站首页>[error reporting] "typeerror: cannot read properties of undefined (reading 'split')“
[error reporting] "typeerror: cannot read properties of undefined (reading 'split')“
2022-07-05 00:09:00 【Blog Zhu hukang】
Report the wrong question
In the use of split() Method is divided into strings , The red information is as follows :Cannot read properties of undefined (reading ‘split‘)
Error reporting analysis
Before dividing the data , First judge whether the current data is empty ; If you don't judge the data , Can cause an exception . So in calling splid() Function before , You need to make a non empty judgment on the data that currently needs to be segmented ( Or call when the data is not empty ).
Error reporting solution
Before dividing the data , First judge whether the current data is empty ; If you don't judge the data , Can cause an exception . So in calling splid() Function before , You need to make a non empty judgment on the data that currently needs to be segmented ( Or call when the data is not empty ).
const imgUrl = "https://tu.cloud.cn/flower/flower-size.jpg?size=1800";
// When the data is not empty
if(imgUrl) {
// Intercept Then splice the new string
const newImgUrl = imgUrl.split('?')[0] + "?size=600";
console.log(newImgUrl); //https://tu.cloud.cn/flower/flower-size.jpg?size=600
}
边栏推荐
- 如何报考PMP项目管理认证考试?
- GDB常用命令
- Ap8022 switching power supply small household appliances ACDC chip offline switching power supply IC
- 同事的接口文档我每次看着就头大,毛病多多。。。
- 人生无常,大肠包小肠, 这次真的可以回家看媳妇去了。。。
- XML的解析
- 企业公司项目开发好一部分基础功能,重要的事保存到线上第一a
- Application of fire fighting system based on 3D GIS platform
- [论文阅读] CarveMix: A Simple Data Augmentation Method for Brain Lesion Segmentation
- Build your own minecraft server with fast parsing
猜你喜欢

多回路仪表在基站“转改直”方面的应用
![[IELTS reading] Wang Xiwei reading P4 (matching1)](/img/91/1b3f85410035f65acb0c205185f698.png)
[IELTS reading] Wang Xiwei reading P4 (matching1)

Jar batch management gadget

如何避免电弧产生?—— AAFD故障电弧探测器为您解决

How to do the project of computer remote company in foreign Internet?

Summer challenge brings you to play harmoniyos multi terminal piano performance

用快解析内网穿透实现零成本自建网站

Fast analysis -- easy to use intranet security software

Consolidated expression C case simple variable operation

PMP certificate renewal process
随机推荐
海思3559万能平台搭建:YUV422的踩坑记录
The waterfall flow layout demo2 (method 2) used by the uniapp wechat applet (copy and paste can be used without other processing)
如何避免电弧产生?—— AAFD故障电弧探测器为您解决
C语言中sizeof操作符的坑
OpenHarmony资源管理详解
Introduction to ACM combination counting
Fast parsing intranet penetration helps enterprises quickly achieve collaborative office
How to effectively monitor the DC column head cabinet
[论文阅读] CarveMix: A Simple Data Augmentation Method for Brain Lesion Segmentation
企业应用业务场景,功能添加和修改C#源码
巩固表达式C# 案例简单变量运算
[kotlin] the third day
【雅思阅读】王希伟阅读P3(Heading)
[IELTS reading] Wang Xiwei reading P4 (matching1)
Actual combat simulation │ JWT login authentication
Specification for fs4061a boost 8.4v charging IC chip and fs4061b boost 12.6V charging IC chip datasheet
[论文阅读] TUN-Det: A Novel Network for Thyroid Ultrasound Nodule Detection
Nine Qi single chip microcomputer ny8b062d single key control four LED States
Summary of week 22-07-02
多回路仪表在基站“转改直”方面的应用