From 7ab7e900ad2c63854d04230287056393f73cd8c4 Mon Sep 17 00:00:00 2001 From: Jean Wasilewski Date: Fri, 31 Oct 2014 11:27:24 +0100 Subject: [PATCH] file function added --- js/crep.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+), 0 deletions(-) diff --git a/js/crep.js b/js/crep.js index d944482..5241a0f 100755 --- a/js/crep.js +++ b/js/crep.js @@ -1,3 +1,19 @@ +function file(fichier) +{ + if(window.XMLHttpRequest) + xhr_object = new XMLHttpRequest(); + else if(window.ActiveXObject) + xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); + else + return(false); + xhr_object.open("GET", fichier, false); + xhr_object.send(null); + if(xhr_object.readyState == 4) + return(xhr_object.responseText); + else + return(false); +} + function loadNewDoc(doc) { $("#mainContainer").html(file(doc)); -- libgit2 0.21.2