最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Encoding a line break in a string without using HTML - Stack Overflow

programmeradmin0浏览0评论

Is there a way to encode a line break into a string without using any HTML entities or tags? Specifically, I would like a string that I pass into the dojox.gfx renderer to display a line break.

Is there a way to encode a line break into a string without using any HTML entities or tags? Specifically, I would like a string that I pass into the dojox.gfx renderer to display a line break.

Share Improve this question asked Jul 25, 2012 at 19:52 allenylzhouallenylzhou 1,4614 gold badges19 silver badges36 bronze badges 1
  • usually \n is the charachter representing a line break, but I don't know dojox.gfx – Naigel Commented Jul 25, 2012 at 19:55
Add a ment  | 

1 Answer 1

Reset to default 4

You can escape it with \n or \u000A, see:

How do I break a string across more than one line of code in JavaScript?

发布评论

评论列表(0)

  1. 暂无评论