Takazudo
3/5/2011 - 3:09 PM

put the code of the very last script element into pre element.

put the code of the very last script element into pre element.

function writeLastCode(){
	var $s = $('script');
	document.write('<pre></pre>');
	var $pre = $('pre').last();
	$pre.last().text($($s[$s.length-2]).text().replace(/\t/g,'    ').replace(/\n/,''));
}

/*
	use like following

	<script>
	alert('hoge');
	</script>
	<script>writeLastCode();</script>

*/