Created
March 5, 2011 15:09
-
-
Save Takazudo/856419 to your computer and use it in GitHub Desktop.
put the code of the very last script element into pre element.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment