CSS-Tricks Example

Highlighting

PHP Highlighting

<?php 
  $i 
1
  
  function 
rockOut() {
      
alert("wah wah wah");
  }
?>

JavaScript Highlighting


<script type="text/javascript"> 
        $(function() {
	   $('body').addClass('js-enabled');
	   if (true) {
		     // do stuff
		}  
	});

</script>

Bigger File, grabbed with file_get_contents


<script type="text/javascript"> 

jQuery(function(){
	jQuery("ul#mainNav li:not('.iphone') a").hover(function() {
		if(jQuery(this).attr("rel") == "")
		{ jQuery(this).attr("rel"jQuery(this).css("background-color"));
			}
		jQuery(this).stop().css({
			backgroundColorjQuery(this).attr("rel")
			}).animate({
			backgroundColor"#fe4902"
			}, 300);
		}, function() {
		jQuery(this).stop().animate({
			backgroundColorjQuery(this).attr("rel")
			}, 300);
		});
	jQuery("#moving-links a").hover(function(){
		jQuery(this).stop().animate({
			paddingLeft"20px"
			}, 300);
		}, function(){
		jQuery(this).stop().animate({
			paddingLeft"0px"
			}, 300);
		});
	getTwitters('tweet', {
		id'chriscoyier'count1enableLinkstrueignoreRepliesfalse,
		template'%text%',
		timeout8000,
		onTimeout: function () {
			this.innerHTML 'Twitter is being slow... this area will only load if Twitter is being a good boy.';
			},
		onTimeoutCanceltrue
		});
	jQuery('a').filter(function() {
		var theHref this;
		if (theHref.hostname && theHref.hostname !== location.hostname) {
			jQuery(theHref).bind('click keypress', function(event) {
				var code=event.charCode || event.keyCode;
				if (!code || (code && code == 13)) {
					if(pageTracker){
						var fixedLink this.href;
						fixedLink fixedLink.replace(/https?:\/\/(.*)/,"$1");
						fixedLink '/outgoing/' fixedLink;
						pageTracker._trackPageview(fixedLink);
						};
					};
				});
			};
		});
	});

</script>