JSFiddle - React, Tailwind, and code Playground
JavaScript
/*
jsfiddle.net's ECHO API--sends back the XML we specify in the params--for this demo only
*/
var url = 'http://www.devguru.com/technologies/ecmascript/quickref/doc_open.html';
/*
The XMl to send and a delay period to wait (delay makes the demo look more realistic )
*/
var params = 'xml=' + encodeURIComponent( '<?xml version="1.0" encoding="UTF-8" ?><GALERIES><GALERIE>ghghgh</GALERIE><GALERIE>other info</GALERIE></GALERIES>' ) + '&delay=2';
var http = new XMLHttpRequest();
http.open( 'POST', url ); //(using POST here because the echo API requires it)
/*
The function which executes whenever request's ready state changes. When state is complete and status is 200, we act on the response
*/
http.onreadystatechange = function()
{
if( http.readyState === 4 && http.status === 200 )
{
xmlDoc = http.responseXML;
alert( http.responseText);
}
}
/*
With all the above setup, fire it
*/
http.send( params );