Have been trying to figure this one out for some time, but still can not get this AJAX script to work with Internet Explorer. It works with all other browsers. Thanks in Advance!
FORM CODE
<script language="JavaScript" type="text/javascript" src="aj.js">
</script>
<input type="text" value="#CCC" id="paints" size="7">
<input type="button" value="submit" id="gColor" onclick=
"handleIT();colorIT()"> <input type="text" id="textBack">
<div class="c1" id="divBack">Dynamically Paint Here.</div>
aj.php CODE
<?php
$paint = trim($_POST['paints']);
echo trim($paint);
?>
aj.js AJAX POST CODE
function getXmlHttpRequestObject() { if (window.XMLHttpRequest) { return new XMLHttpRequest();} else if(window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP");} else {}}
var search7 = getXmlHttpRequestObject();
function handleIT() { if (search7.readyState == 4 || search7.readyState == 0) {
var paints = escape(document.getElementById('paints').value);
var parameters="paints="+paints;
search7.open("POST", 'aj.php', true);
search7.onreadystatechange = colorIT;
search7.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
search7.send(parameters);
}}
function colorIT() { if (search7.readyState == 4) {
var paints = escape(document.getElementById('paints').value);
document.getElementById("textBack").value=search7.responseText;
document.getElementById("divBack").style.backgroundColor=search7.responseText;
}}