百度富文本编辑器js用什么压缩的

JavaScript013

百度富文本编辑器js用什么压缩的,第1张

用 document.getElementsByTagName('A') 取得A标签集合,然后遍历该集合即可. 编辑器通常在iframe里,所以要使用iframe的contentWindow来访问document对象. 或者,用正则去匹配编辑器的HTML里的A标签,也很容易实现,但不如遍历集合方便

description = description.replace(/(\n)/g, "")

description = description.replace(/(\t)/g, "")

description = description.replace(/(\r)/g, "")

description = description.replace(/<V?[^>] >/g, "")

description = description.replace(/\s /g, "")