Skip to content

Instantly share code, notes, and snippets.

@hiroshi-maybe
Created January 8, 2012 06:39
Show Gist options
  • Save hiroshi-maybe/1577494 to your computer and use it in GitHub Desktop.
Save hiroshi-maybe/1577494 to your computer and use it in GitHub Desktop.
instantly check javascript whether it can be compiled to not.
<html>
<head>
<script type="text/javascript"
src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>//<![CDATA[
$(document).ready(function(){
var p = function(val){
$("#result").append(val+"<br/>");
};
$("#eval-btn").click(function(){
eval($("#input").val());
});
$("#clear-btn").click(function(){
$("#result").empty();
});
});
//]]></script>
</head>
<body>
<div>p: method to show messages on screen</div>
<textarea id="input" rows="400" cols="100" style="float:left"></textarea>
<div style="float:left">
<button id="eval-btn" style="float:left">eval</button>
<button id="clear-btn" style="float:left">clear</button>
<div id="result" style="clear:left">log:<br/></div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment