开发者

Jquery beautyofCode show code lines from a string

I'm using BeautyofCode jQuery plugin, but i can't understand 1 thing.

I submit a piece of code by a simple textarea then save that i开发者_如何转开发nto db record.

Once i retrieve piece of code from db as a string js plugin show me code all in 1 line, wondering how to split lines when submitting code from textarea? :P


The line breaks are probably being saved as \n and when you look at what comes from the database you don't see the line-breaks because HTML does not recognize \n, what you need to do is convert all \n's to <br />'s so the HTML will display appropriately.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜