MCPcopy
hub / github.com/jabbany/CommentCoreLibrary / fetchFile

Function fetchFile

demo/scripting/sandbox.js:32–43  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

30 };
31 });
32 function fetchFile(filename){
33 var xhr = new XMLHttpRequest();
34 xhr.onreadystatechange = function(){
35 if(xhr.readyState === 4 && xhr.status== 200){
36 $("code-input").value = xhr.responseText;
37 }else if(xhr.readyState === 4){
38 bscripter.logger.warn("Load file failed. Server responded with status code " + xhr.status + ".");
39 }
40 };
41 xhr.open("GET", filename, true);
42 xhr.send();
43 }
44 function onResize(){
45 $("player").style.perspective = $("player").offsetWidth * Math.tan(40 * Math.PI/180) / 2 + "px";
46 $("player").webkitPerspective = $("player").offsetWidth * Math.tan(40 * Math.PI/180) / 2 + "px";

Callers 1

sandbox.jsFile · 0.85

Calls 3

warnMethod · 0.80
$Function · 0.70
sendMethod · 0.45

Tested by

no test coverage detected