Created
May 22, 2017 16:06
-
-
Save codeyu/c86c1ce4746f7273dfaf5157360569c5 to your computer and use it in GitHub Desktop.
This file contains 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
<!DOCTYPE html> | |
<html> | |
<body> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> | |
<script> | |
$(document).ready(function(){ | |
$("button").click(function(){ | |
var to_compile = { | |
"LanguageChoice": "1", | |
"Program": $("#code").val(), | |
"Input": "", | |
"CompilerArgs" : "" | |
}; | |
$.ajax ({ | |
url: "http://rextester.com/rundotnet/api", | |
type: "POST", | |
data: to_compile | |
}).done(function(data) { | |
alert(JSON.stringify(data)); | |
}).fail(function(data, err) { | |
alert("fail " + JSON.stringify(data) + " " + JSON.stringify(err)); | |
}); | |
}); | |
}); | |
</script> | |
</head> | |
<textarea id="code"> | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
namespace Rextester | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
//Your code goes here | |
Console.WriteLine("Hello, world!"); | |
} | |
} | |
} | |
</textarea> | |
<button id="run">Run</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
fail {"readyState":0,"responseText":"","status":0,"statusText":"error"} "error" why only the result?