请教:有关ajax异步取出数据显示问题
时间:2010-11-22
来源:互联网
我通过ajax技术异步请求一个php文件,根据传入的参数取出一个array集合,
接着用phpjson类把字符给转换成json类型,
获得json["content"]的数据时,
在替换<div id="content"></div>后内容中的加粗,换行标签之间显示出来了,而不显示换行,加粗的效果了,也就是说原本几段的内容都变成一段了
content中的内容是通过ckeditor插件输入的
请教该如何解决?
接着用phpjson类把字符给转换成json类型,
获得json["content"]的数据时,
在替换<div id="content"></div>后内容中的加粗,换行标签之间显示出来了,而不显示换行,加粗的效果了,也就是说原本几段的内容都变成一段了
content中的内容是通过ckeditor插件输入的
请教该如何解决?
作者: allen2010lp 发布时间: 2010-11-22
\r\n等在html中没有效果的
你把\r\n之内的换成<br/>
你把\r\n之内的换成<br/>
作者: cj205 发布时间: 2010-11-22
我取出的数据在页面上显示的内容格式为:
Steve was founder and Creative Director of HHCL – the agency voted Campaign’s Agency of the Year three times and Campaign’s Agency of the Decade in January 2000. This unique award was given because of HHCL’s “iconoclastic attitude both to the work and the way it does business”.<br /><br />HHCL’s campaigns included; Tango, Pot Noodle, The AA, Egg, Go, Greenpeace, First Direct, Maxell Tapes, Fuji Film and Danepak Bacon.<br /><br />Prior to HHCL, Steve worked at GGT and WCRS.<br /><br />Post-HHCL, he worked as Executive Creative Director at TBWA/London 2006 - 2008, where he oversaw multi-platform work for clients like Playstation, Adidas, Skittles, Nissan Qashqai, and Elastoplast.<br /><br />In July, 2009, he entered the Hall of Fame of FIAP (Ibero-American Advertising Festival).<br /><br />Steve has won most of the major creative awards, including the D&AD Gold Pencil, the Grand Prix at Cannes, the Grand Prix at the British Television Awards, the President’s Award at the Royal Television Society awards, and the President’s Award at Creative Circle (twice). But he is far more interested in what’s coming up next.<br /><br />Steve has spoken at advertising conferences all around the world – in the USA, Kenya, South Africa, Thailand, Singapore, Indonesia, Hong Kong, Australia, Ireland, France, Germany, Italy, Austria, Sweden and Holland.<br /><br /> In 2008, Steve was one of the founding members of Campaign’s Hall of Fame, a list of the 40 most influential people in British advertising over the last 50 years. He was the youngest person on the list by about 5 years !
但换行显示的是标签</br>里面还有其它标签,比如 等等, 我想显示的是具体效果,请教~~
Steve was founder and Creative Director of HHCL – the agency voted Campaign’s Agency of the Year three times and Campaign’s Agency of the Decade in January 2000. This unique award was given because of HHCL’s “iconoclastic attitude both to the work and the way it does business”.<br /><br />HHCL’s campaigns included; Tango, Pot Noodle, The AA, Egg, Go, Greenpeace, First Direct, Maxell Tapes, Fuji Film and Danepak Bacon.<br /><br />Prior to HHCL, Steve worked at GGT and WCRS.<br /><br />Post-HHCL, he worked as Executive Creative Director at TBWA/London 2006 - 2008, where he oversaw multi-platform work for clients like Playstation, Adidas, Skittles, Nissan Qashqai, and Elastoplast.<br /><br />In July, 2009, he entered the Hall of Fame of FIAP (Ibero-American Advertising Festival).<br /><br />Steve has won most of the major creative awards, including the D&AD Gold Pencil, the Grand Prix at Cannes, the Grand Prix at the British Television Awards, the President’s Award at the Royal Television Society awards, and the President’s Award at Creative Circle (twice). But he is far more interested in what’s coming up next.<br /><br />Steve has spoken at advertising conferences all around the world – in the USA, Kenya, South Africa, Thailand, Singapore, Indonesia, Hong Kong, Australia, Ireland, France, Germany, Italy, Austria, Sweden and Holland.<br /><br /> In 2008, Steve was one of the founding members of Campaign’s Hall of Fame, a list of the 40 most influential people in British advertising over the last 50 years. He was the youngest person on the list by about 5 years !
但换行显示的是标签</br>里面还有其它标签,比如 等等, 我想显示的是具体效果,请教~~
作者: allen2010lp 发布时间: 2010-11-22
引用 1 楼 cj205 的回复:
\r\n等在html中没有效果的
你把\r\n之内的换成<br/>
\r\n等在html中没有效果的
你把\r\n之内的换成<br/>
我取出的数据在页面上显示的内容格式为:
Steve was founder and Creative Director of HHCL – the agency voted Campaign’s Agency of the Year three times and Campaign’s Agency of the Decade in January 2000. This unique award was given because of HHCL’s “iconoclastic attitude both to the work and the way it does business”.<br /><br />HHCL’s campaigns included; Tango, Pot Noodle, The AA, Egg, Go, Greenpeace, First Direct, Maxell Tapes, Fuji Film and Danepak Bacon.<br /><br />Prior to HHCL, Steve worked at GGT and WCRS.<br /><br />Post-HHCL, he worked as Executive Creative Director at TBWA/London 2006 - 2008, where he oversaw multi-platform work for clients like Playstation, Adidas, Skittles, Nissan Qashqai, and Elastoplast.<br /><br />In July, 2009, he entered the Hall of Fame of FIAP (Ibero-American Advertising Festival).<br /><br />Steve has won most of the major creative awards, including the D&AD Gold Pencil, the Grand Prix at Cannes, the Grand Prix at the British Television Awards, the President’s Award at the Royal Television Society awards, and the President’s Award at Creative Circle (twice). But he is far more interested in what’s coming up next.<br /><br />Steve has spoken at advertising conferences all around the world – in the USA, Kenya, South Africa, Thailand, Singapore, Indonesia, Hong Kong, Australia, Ireland, France, Germany, Italy, Austria, Sweden and Holland.<br /><br /> In 2008, Steve was one of the founding members of Campaign’s Hall of Fame, a list of the 40 most influential people in British advertising over the last 50 years. He was the youngest person on the list by about 5 years !
但换行显示的是标签</br>里面还有其它标签,比如 等等, 我想显示的是具体效果,请教~~
作者: allen2010lp 发布时间: 2010-11-22
先replace掉 等
这个是必须的
这个是必须的
作者: cj205 发布时间: 2010-11-22
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28