jQuery CodeView Plugin v - To View The Code With Beautiful Style

		This plugin is to help programer share their code with no pain.
		When sharing the code, the programer must modify all tag character < and > to &lt; and &gt; inside the code.
		And programer must control the tab and white space character carefully while pasting the code, or people will hard to read.
		This is really boring and troublesome routine. Besides, it is impossible for programer spent more time to add color style inside the code.
		
		This problem bother me too. So, I write this plugin.
		I hope this plugin make it conveniently while sharing the code. So, Enjoy it!!! :^)
		
Download Here
Simple Example

HTML

				<pre id="javascript_block">
					
Hello World!
Hello World! /** * This is a test function * @return nothing */ function test(msg, status) { if( status ) { alert('show me the money!'); // just kidding return true; } else { alert("no money here"); return false; } } </pre>

Javascript

				jQuery("#javascript_block").codeview();
				
				jQuery("#javascript_block").codeview({
					fontSize: "1.2em",
					tabToSpace: -1,
					feedColor: false
				});
			

Demo

				
Hello World!
Hello World! /** * This is a test function * @return nothing */ function test(msg, status) { if( status ) { alert('show me the money!'); // just kidding return true; } else { alert("no money here"); return false; } }
				/**
				 * This is a test function
				 * @return nothing
				 */
				function test(msg, status) {
					if( status ) {
						alert('show me the money!'); // just kidding
						return true; 
					} else {
						alert("no money here");
						return false;
					}
				}
			
Complex Example

HTML

<pre id="javascript_block">
	/**
	 * this is a test function
	 * keyword: function, var, return, try, catch, true, false
	 * keyword: function, var, return, try, catch, true, false
	 *
	 * @param msg testing message
	 * @param status testing status
	 * @return nothing to return
	 */
	function test(msg, status) {
		var test = '123';
		var test2 = "12345676";
		// keyword: function, var, return, try, catch, true, false
		while(true) {
			alert('show me the money!');
		}
		try {
			alert("success!");
		} catch {
			alert("error!");
		} finally {
			alert('return');
		}
		
		if( msg == 'test' ) {
			return true;
		} else {
			return false;
		}
	}
	
	/**
	 * this is a test function too
	 * keyword: function, var, return, try, catch, true, false
	 *
	 * @author David Hung
	 */
	function test2(msg) {
		alert('test');
		alert("string");
		if( true ) {
			return true;
		} else {
			return false;
		}
		xxif gg
		xx if gg
		return true;
	}
</pre>

Javascript

				jQuery("#javascript_block").codeview();
			

Demo

				/**
				 * this is a test function
				 * keyword: function, var, return, try, catch, true, false
				 * keyword: function, var, return, try, catch, true, false
				 *
				 * @param msg testing message
				 * @param status testing status
				 * @return nothing to return
				 */
				function test(msg, status) {
					var test = '123';
					var test2 = "12345676";
					// keyword: function, var, return, try, catch, true, false
					while(true) {
						alert('show me the money!');
					}
					try {
						alert("success!");
					} catch {
						alert("error!");
					} finally {
						alert('return');
					}
					
					if( msg == 'test' ) {
						return true;
					} else {
						return false;
					}
				}
				
				/**
				 * this is a test function too
				 * keyword: function, var, return, try, catch, true, false
				 *
				 * @author David Hung
				 */
				function test2(msg) {
					alert('test');
					alert("string");
					if( true ) {
						return true;
					} else {
						return false;
					}
					return true;
				}
			

Attributes

Known Issues

Browser Compatibility