Friday, August 29, 2008

How do I display code on a web page?

Something this simple can appear quite tricky as the browser will attempt to render any HTML and JavaScript code it encounters. Once simple solution is to include the code you want to display in a separate text (.txt) file. Simply link to that file, and being text, the browser will not attempt to render the code.

The links below provide some additional resources for displaying page code including some automatic conversion utilities that will make short work of the conversion process.

Displaying HTML Source Code in Web Pages

Display Markup with the Text Munger

How to display HTML code in your web pages

How To Display PHP Code In A Web-page

No comments: