enmi12/glossaire/js/ajax.js
author ymh <ymh.work@gmail.com>
Mon, 08 Sep 2025 19:44:41 +0200
changeset 23 417f20492bf7
parent 0 d970ebf37754
permissions -rwxr-xr-x
Update Docker configuration and plugin versions - Upgrade MariaDB from 10.6 to 11 with auto-upgrade support - Add WordPress debug environment variable to FPM container - Update PHP-FPM Dockerfile base image - Update Include Mastodon Feed plugin with bug fixes and improvements - Update Portfolio plugin (v2.58) with latest translations and demo data enhancements - Remove old README.md from Mastodon Feed plugin 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>

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); 
}