用JS实现语法高亮

in Develop

今天唯枫给我传了一个好东东,他如是说。

接收后,一看,的确不错。可以实现十多种语法的高亮,

如:C#、VB、Ruby、CSS等,

而调用也很简单,只需在页面中引用指定的js文件,用dp.SyntaxHighlighter.HighlightAll(‘code’);方法即可,code就是你的Textarea的ID

体验地址:

http://yibin.us/tools/SyntaxHighlighter/index.html

下载地址:

http://yibin.us/download/dp.SyntaxHighlighter.rar

3 Comments

3 Comments

  1. 其实我非常的不喜欢JS语法高亮,简直是把负担转移到访客的身上了,要是一个页面用得多的话,打开还非常的慢。

    我的博客以前就试过,差点没把我卡死。。。后来放弃使用了。

  2. 啊?
    我还正准备用呢,,看来先放弃再说:D

Leave a Reply

Using Gravatars in the comments - get your own and be recognized!

XHTML: These are some of the tags you can use: <a href=""> <b> <blockquote> <code> <em> <i> <strike> <strong>