【发布时间】:2011-08-18 21:33:16
【问题描述】:
问题:
By Rosa Golijan <br/><br/>The next time someone interrupts you to proclaim that "retweet"
or "woot" aren't actual words, laugh in his or her face and point to a copy of the
Concise Oxford English Dictionary. <br/> <br/>Yes, one of the main authorities on the
English language is officially acknowledging some of the silly terms we've been using
lately. <br/> <br/>The twelfth edition of the Concise Oxford English Dictionary
includes over 400 new words — many of which are related to social media and technology.
According to the folks behind the esteemed reference text, these additions "are just
carrying on the tradition of a dictionary that has always sought to be progressive and
up to date."
问题:我很难找到一种简单的方法让我的动态 jquery 代码将 html 标记呈现为 html,而不是简单地将带有 html 中断标记的文本显示为文本的一部分。数据库/服务器端的文本最初包含换行符,然后我将这些新行转换为 (br/) 标记以进行 html 格式设置。现在由于文本以 json 格式返回,因此 html 标签按字面意思显示。
现在我使用 jquery .html() 和 .text() 进行测试,但 html 标记仍显示为文本的一部分。
感谢您的建议。当我有机会时,我会尝试一下。我正在使用 Salesforce,它有一些内置功能可以用它的专有组件处理这些问题,我只是想摆脱使用它们,因为它们不像我需要的那样动态。但是我能够强迫他们变得更有活力。
另外,JS Fiddle 是我以前从未听说过的东西。我一直随身携带两台笔记本电脑去工作,一台装有 Dreamweaver,一台是装有我所有其他必要软件的机器。没有dreamweaver 来测试jquery 成为一个问题,我不知道有一个基于云的工具可以让我做我在dreamweaver 中做的事情。非常感谢Chief先生的建议,这真的会派上用场!
还有什么其他工具可以让我使用吗?
【问题讨论】:
-
您在哪里显示此文本?你能粘贴一些你的代码吗? jquery 的 .html() 使用浏览器的 innerHTML 属性,因此它应该可以正确呈现。
标签: jquery newline break carriage-return