What is ­ and how do i get rid of it

前端 未结 4 718
日久生厌
日久生厌 2021-02-10 00:25

I have noticed, while looking at my page source, the characters ­ showing just after a

tag. I went trough my coding and can\'t find
4条回答
  •  爱一瞬间的悲伤
    2021-02-10 00:37

    This script will find and remove all the invisible ­s on your page:

    document.body.innerHTML=document.body.innerHTML.replace(/\u00AD/g, '');
    

    It works by searching for the Unicode character U+00AD. It's invisible when it doesn't sit at a line break, which is probably why you can't find it in your code.

提交回复
热议问题