Http://www.jb51.net/jiaoben/15599.html
Syntaxhighlighter is a small open source project that highlights the various program source code syntax in a Web page. Support the various programming languages currently in vogue:
C #, CSS, C + +, Delphi, Java, JavaScript, PHP, Python, Ruby, SQL, Visual Basic, xml/html
How to use:
1, assuming that the Web page file test.htm stored in a directory, the Dp.syntaxhighlighter will be extracted to the subdirectory under the directory, assuming that images
2, insert the following code between the
Copy Code code as follows:
<link type= "Text/css" rel= "stylesheet" href= "Images/styles/syntaxhighlighter.css" ></link>
3, in the page to display the source code of the program to insert the following code (of which the class= "JS" indicates the source code in JS syntax, other can be set the class values are
C #, CSS, C, Delphi, Java, JS, PHP, Python, Ruby, SQL, VB, xml:
Copy Code code as follows:
<textarea name= "code" class= "JS" rows= "cols=" >
The program source code is here.
</textarea>
4. Insert the following code before </body> at the end of the page:
Copy Code code as follows:
<script class= "javascript" src= "Images/scripts/shcore.js" ></script>
<script class= "javascript" src= "Images/scripts/shbrushcsharp.js" ></script>
<script class= "javascript" src= "Images/scripts/shbrushphp.js" ></script>
<script class= "javascript" src= "Images/scripts/shbrushjscript.js" ></script>
<script class= "javascript" src= "Images/scripts/shbrushjava.js" ></script>
<script class= "javascript" src= "Images/scripts/shbrushvb.js" ></script>
<script class= "javascript" src= "Images/scripts/shbrushsql.js" ></script>
<script class= "javascript" src= "Images/scripts/shbrushxml.js" ></script>
<script class= "javascript" src= "Images/scripts/shbrushdelphi.js" ></script>
<script class= "javascript" src= "Images/scripts/shbrushpython.js" ></script>
<script class= "javascript" src= "Images/scripts/shbrushruby.js" ></script>
<script class= "javascript" src= "Images/scripts/shbrushcss.js" ></script>
<script class= "javascript" src= "Images/scripts/shbrushcpp.js" ></script>
<script class= "JavaScript" >
Dp. Syntaxhighlighter.highlightall (' Code ');
</script>