function xmlRequest(event){
var req = null;
//document.ajax.dyn.value="Started...";
if (window.XMLHttpRequest)
{
req = new XMLHttpRequest();
if (req.overrideMimeType)
{
req.overrideMimeType('text/xml');
}
}
else if (window.ActiveXObject)
{
try {
req = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e)
{
try {
req = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
req.onreadystatechange = function()
{
//var loadingContent =
//$('.commentSection').append('
if(req.readyState == 4)
{
if(req.status == 200)
{
// process a XML document here
var xml = req.responseXML;
$xml = $(xml);
var mot = $(event.target).first().parents('div[data-mot]').attr('data-mot');
var typologie = $(event.target).first().parents('div[data-mot]').attr('class');
typologie = typologie.replace(/(arsIndustrialis|discipline|thematique|vulgarisation) /gi, '');
console.log(typologie);
var commentaires = $xml.find('mot[name]').filter(function() {return removeAccents($(this).attr("name").toLowerCase()) == mot;});
var typologieComment = commentaires.children();
}
else
{
alert("Error: returned status code " + req.status + " " + req.statusText);
}
}
};
req.open("GET", "comments.xml", true);
req.send(null);
}