// # (gH) -_- m1xml.js ; TimeStamp (unix) : 16 Novembre 2017 vers 17:24
// ###################################################################################
function partie(nump=0) {
// ###################################################################################
if (nump==0) { window.location.href="m1xml.php" ; } ;
var url = "#" ;
if (nump==1) {
url = "m1xml_1_introduction.php" + "?standalone=FALSE"
} // fin si
if (nump==2) {
url = "m1xml_2_structure.php" + "?standalone=FALSE"
} // fin si
if (nump==3) {
url = "m1xml_3_valide.php" + "?standalone=FALSE"
} // fin si
if (nump==4) {
url = "m1xml_4_transforme.php" + "?standalone=FALSE"
} // fin si
if (nump==5) {
url = "m1xml_5_conclusion.php" + "?standalone=FALSE"
} // fin si
if (nump==6) {
url = "m1xml_6_exercices.php" + "?standalone=FALSE"
} // fin si
if (nump==61) {
url = "m1xml_6_tp1.php" + "?standalone=TRUE"
window.document.location.href="m1xml_6_tp1.php" ;
} // fin si
if (nump==62) {
url = "m1xml_6_tp2.php" + "?standalone=TRUE"
window.document.location.href="m1xml_6_tp2.php" ;
} // fin si
if (nump>0) {
// OK : ocument.location.href = url
var xhr;
try { xhr = new ActiveXObject('Msxml2.XMLHTTP'); }
catch (e) {
try { xhr = new ActiveXObject('Microsoft.XMLHTTP'); }
catch (e2) {
try { xhr = new XMLHttpRequest(); }
catch (e3) { xhr = false; }
}
} // fin du catch
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
// on transmet tout le fichier
document.getElementById("contenu").innerHTML = xhr.responseText ;
} else {
document.getElementById("contenu").innerHTML= "<h1>Error code " + xhr.status + "</h1>" ;
} ; // fin de xhr.status == 200
} ; // fin de xhr.readyState == 4
} ; // fin de fonction xhr.onreadystatechange
xhr.open("GET", url+"?standalone=FALSE", true);
xhr.send(null);
} // fin si
} // fin de fonction partie
// ###################################################################################
function montreSolution(numeroExercice) {
// ######################################################################
// rend visible la division qui contient la solution
window.document.getElementById("solution"+numeroExercice).setAttribute("class","visible") ;
window.document.getElementById("bsol"+numeroExercice).innerHTML =" masquer la solution " ;
window.document.getElementById("bsol"+numeroExercice).setAttribute("onclick","masqueSolution("+numeroExercice+") ; return false")
window.document.getElementById("bsol"+numeroExercice).setAttribute("class","bouton_fin orange_pastel nou nobold") ;
} ; // fin de fonction montreSolution
// ######################################################################
function masqueSolution(numeroExercice) {
// ######################################################################
// rend visible la division qui contient la solution
window.document.getElementById("solution"+numeroExercice).setAttribute("class","invisible") ;
window.document.getElementById("bsol"+numeroExercice).innerHTML =" afficher la solution " ;
window.document.getElementById("bsol"+numeroExercice).setAttribute("onclick","montreSolution("+numeroExercice+") ; return false")
window.document.getElementById("bsol"+numeroExercice).setAttribute("class","bouton_fin vert_pastel nou nobold") ;
} ; // fin de fonction masqueSolution
|