关于文本域的显示处理

1:后端保存的文本域的内容要回显到文本域中

        contentStr=contentStr.replaceAll("\n", "<br/>");
        contentStr=contentStr.replaceAll(" ", "&nbsp;");

2:前端非文本域的内容要展现到文本域中

            var content=$j(showRebackContent1).html();
            content=content.replace(/<br\s*\/?>/ig,"\n")
            content=content.replace(/&nbsp;/ig, " ");

猜你喜欢

转载自blog.csdn.net/qq_20594019/article/details/102860348