开发者

php syntax coloring with HTML and jQuery

is it possible to have a <textarea> widget to support php syntax coloring with jQuery?

In short, I'd need to colorize code while the user is typing it into the textarea.

It would be great if line numbers were shown too, but it is not strictly necessary.

Any other framework w开发者_开发百科ould eventually be welcome.

Thanks.


There's a neat javascript library called CodeMirror that allows to do that.

There's the option to display line numbers, and works in real time, for a variety of languages, including PHP.

It is not related to and does not depend on jQuery.


You can change the color of the textarea in the onchange with:

onchange="$(this).css('color','#00FF00')"
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜