Are you a Java developer that runs a tutorial site or writes the occasional tut? If you are, you might be on the lookout for some easy ways to post formatted code snippets into your WordPress posts. Take a look at any of these plugins to learn more about how to easily add JavaScript code (or HTML, CSS, etc) to your posts and tutorials.
1. Code Markup
Code Markup makes it easy to include code snippets in your pages. The plugin can intuitively tell which tags and characters should be displayed as part of the code snippet and which should be rendered as HTML/JavaScript, etc.
2. CodeColorer
CodeColorer is a code snippet plugin that inserts code that is formatted with the appropriate syntax and highlighting depending on the language.
Developer Formatter uses a highlight system and includes support for over 110 languages, which makes it a one-size-fits-all plugin and reduces the number of plugins you might need for your site if you include tutorials for many different languages.
This plugin will highlight your code snippets according to Alex Gorbatchev’s syntax highlighting and supports over 10 languages, including JavaScript, Java, and VB.
5. File Inliner
File Inliner will display the whole content of a file in a WordPress post — perfect to use if your code snippets are particularly long, or if you want to include many elements (<head>, <body>, <scripts>, etc).