Skip to content

Commit 5490c13

Browse files
committed
tweaking showme utility
1 parent 2dcc8ba commit 5490c13

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

showme.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
<head>
44
<title>Show Me</title>
55
<script src="jquery.js"></script>
6+
<style>#showcode{background-color:#eee;border:1px solid #000;font-weight:bold;font-size:16px;}</style>
67
</head>
78
<body>
9+
<pre id="showcode"></pre>
810
<script src="showme.js"></script>
911
</body>
1012
</html>

showme.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
str = document.location.hash.replace(/^#/,"");
77
if (str.match(/^data:text\/html.*?base64,/)) {
88
str = str.replace(/^data:text\/html.*?base64,/,"");
9-
document.write(atob(str));
9+
str = atob(str);
10+
$("#showcode").text(str);
11+
document.write(str);
1012
}
1113
}
1214
})(window);

0 commit comments

Comments
 (0)