﻿

 
 function getXhr() { 
	 if(window.XMLHttpRequest) 
	 xhr = new XMLHttpRequest(); 
	 else if(window.ActiveXObject)  { 
	 try { xhr = new ActiveXObject("Msxml2.XMLHTTP"); }
	 catch (e) { 
	 xhr = new ActiveXObject("Microsoft.XMLHTTP"); } } 
	 else { 
	 //alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest, veuillez le mettre à jour"); 
	 xhr = false;
	 }
	 return xhr;
 }

 
 function ajax() { 
	 var xhr=getXhr(); xhr.onreadystatechange = function() { 
		 if(xhr.readyState == 4 && xhr.status == 200) { 
		 document.getElementById('cours-ajax').innerHTML = xhr.responseText;
		 //alert(xhr.responseText);
		 } 
	 } 
	 
	 xhr.open("GET",'includes/cours.ajax.php',true); 
	//xhr.open("POST",'http://fr.old.finance.yahoo.com/d/quotes.csv?s=ENTC.PA&f=snl1d1t1c1ohgv&e=.csv',true);
	 //xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 
	xhr.send(null); 
 }



