页面向数据库存值时:

   var reg = new RegExp("\r\n ","g");
   comments = comments.replace(reg,"<br>");

数据库的值回填页面时:php会处理成"/n"

 var reg = new RegExp("\n","g");
   comments = comments.replace(reg," <br>");

相关文章:

  • 2022-12-23
  • 2021-12-29
  • 2022-02-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
  • 2022-12-23
  • 2021-09-26
  • 2022-12-23
  • 2021-11-18
相关资源
相似解决方案