1

Does anyone know any cool jquery snippets that could be used for displaying source code C/C++/Java, on an html page. Normally I just use 'code' blocks, but if there are any cool jquery effects. I am using prettyprint or something like that right now. . Also anyway to enhance the view of diagrams/gifs using jquery. So looking for a solution that gets around the limitations of scrolling thru text. Thanks

2
  • For what purpose? Do you want to display the code on a webpage? Commented Nov 7, 2011 at 0:26
  • Its a tutorial. And I want to make it as readable as possible. So one issue is just that scrolling is kind of difficult to see all the code. If I don't scroll then it takes up too much space. Commented Nov 7, 2011 at 0:34

2 Answers 2

1

Look here: http://alexgorbatchev.com/SyntaxHighlighter/

Sign up to request clarification or add additional context in comments.

1 Comment

Its good. Scrolling still seems to be the technique it users however.
1

I use php pear Text_Highlighter on the server and I think the server is a better place for syntax highlighting.

Advantage is the results are in a <pre /> block opposed to textarea, so you do not end up with a box in the page that has horizontal scrolling, and the syntax highlighting is available to users who have JavaScript disabled.

Also, it does not add line numbers that add to the width of the code example like the popular JS solution does.

I do not know if you are using php but most server side languages have something similar.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.