-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
41 lines (36 loc) · 1.2 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
$(document).ready (function() {
$('h1').click (function(){
$(this.nextElementSibling).toggle();
})
try {
chapter = document.getElementById('chapter').value;
} catch (EventException) {
alert('Chapter niet aangegeven. Voorzie deze pagina van een hidden input met id chapter.');
}
$('#'+chapter).show();
mytextarea = document.getElementById('Ch1p1ex1');
var myCodeMirror1 = CodeMirror.fromTextArea(mytextarea,{
lineNumbers: true
});
//var myCodeMirror2 = CodeMirror(document.body, {
// value: "function myScript2(){return 100;}\n",
// mode: "javascript"
//});
});
function EvaluateAgain(i){
var code = $('textarea#source'+i)[0].value;
uf_urltemp = "functions.php"; //1&XDEBUG_SESSION_START=PHPSTORM";
$.ajax({
type: "GET",
url: uf_urltemp,
data: {codeJSON:code},
datatype: JSON,
success: function (response) {
$('textarea#result' + i)[0].innerHTML = response;
},
error: function (response) {
response += "Oeps, het is niet gelukt om die code uit te voeren.";
$('textarea#result' + i)[0].innerHTML = response;
}
});
}