\u200b (Zero width space) characters in my JS code. Where did they come from?

前端 未结 5 630
失恋的感觉
失恋的感觉 2020-11-27 04:05

I am developing a front end of a web app using NetBeans IDE 7.0.1. Recently I had a very nasty bug, which I finally fixed.

Say I have code

var elemen         


        
5条回答
  •  醉梦人生
    2020-11-27 05:04

    I have similar issue with '\u200b' zero-width space character in my current project. I need to work on JSON object returned from server. Email object with '[at]' need to be replaced with '@' character. Surprisingly, several of the objects had the email address littered with 'space' in and around the '@'.

    Long story short, I checked using Postman and scrutinised the returned JSON as RAW. Here is the raw example:

    johndoe[at]\u200bxyz.org
    

    I could see the character '\u200b' on all those trouble email address. Since only few email addresses affected, I removed the character manually. The server gets the data from Sharepoint.

提交回复
热议问题