Demo entry 6358517

dsds

   

Submitted by anonymous on Apr 25, 2017 at 14:24
Language: JavaScript. Code size: 915 Bytes.

<html>
<head>
<script>
function submitForm(){ 
    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;   }
        }
    }
	xhr.onreadystatechange  =  function() { 
       if(xhr.readyState  == 4)
       {
        if(xhr.status  == 200) 
            document.ajax.dyn="Received:"  + xhr.responseText; 
        else
            document.ajax.dyn="Error code " + xhr.status;
        }
    }; 
	xhr.open( "GET", "data.xml",  true); 
	xhr.send(null); 
} 
</script>
</head>
<body>
    <FORM method="POST" name="ajax" action="">
        <INPUT type="BUTTON" value="Submit"  ONCLICK="submitForm()">
        <INPUT type="text" name="dyn"  value="">
    </FORM>
</body>
</html>

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).