проблема в следующем:
при запуске my.html в ИЕ6, ИЕ7 и ИЕ8(бета версия) выскакивает alert с таким сообщением :
[object Error].
не могу понять в чем проблема
очень надо, плз хэлп
ниже я привел скрипты
в Опере(9.62) и Мозилле(3.0.1) - всё работает нормально
my.html
<html>
<body>
<script type='text/javascript' src='http://localhost/redactor/my.js'></script>
<span id='span' onclick="ajax()">спаннннн</span>
<div id='div'>дивдвдв</div>
</body>
</html>
my.js
var xmlHttpObject=createXmlHttpRequestObject();
/********************************************************************************************************************/
function createXmlHttpRequestObject()
{
var xmlHttp;
try
{
xmlHttp=new XMLHttpRequest();
}
catch(e)
{
var XmlHttpVersions=new Array(
'MSXML2.XMLHTTP.6.0',
'MSXML2.XMLHTTP.5.0',
'MSXML2.XMLHTTP.4.0',
'MSXML2.XMLHTTP.3.0',
'MSXML2.XMLHTTP',
'Microsoft.XMLHTTP'
);
for(var i=0;i<XmlHttpVersions.length && !xmlHttp;i++)
{
try
{
xmlHttp=new ActiveXObject(XmlHttpVersions[i]);
}
catch(e){}
}
}
if(!xmlHttp)
{
alert("Error: object XMLHttpRequest");
}
else
{
return xmlHttp;
}
}
/********************************************************************************************************************/
function ajax()
{
if(xmlHttpObject)
{
try
{
if((xmlHttpObject.readyState==4) || (xmlHttpObject.readyState==0))
{
xmlHttpObject.open("GET","http://localhost/redactor/my.php?option=changeImgDescriptionGallery&nameImg=56_80_small.jpeg",true);
xmlHttpObject.onreadystatechange=handleResultChangeDescription;
xmlHttpObject.send(null);
}
}
catch(e)
{
alert("Error: connection with server \n"+e.toString);
}
}
}
/********************************************************************************************************************/
function handleResultChangeDescription()
{
if(xmlHttpObject.readyState==4)
{
if(xmlHttpObject.status==200)
{
try
{
response=xmlHttpObject.responseXML.documentElement;
var imgName='';
var imgDescription='';
imgName=response.getElementsByTagName("nameImgGallery").item(0).firstChild.data;
imgDescription=response.getElementsByTagName("descriptionImgGallery").item(0).firstChild.data;
document.getElementById('div').innerHTML="<center><input size='12' type='text' id='"+imgName+"Description' value='"+(imgDescription=='falseHoy' ? '' : imgDescription )+"'><br><span class='alink' onclick='saveDescriptionGallery(\""+imgName+"\")'>save</span> <span class='alink' onclick='cancelSaveDescription(\""+imgName+"\")'>cancel</span></center>";
}
catch(e)
{
alert(e.toString());
}
}
else
{
alert("Connection problem; \n"+xmlHttpObject.statusText);
}
}
}
my.php
<?php
if($_POST['option']=='changeImgDescriptionGallery' || $_GET['option']=='changeImgDescriptionGallery' )
{
if(ob_get_length()) ob_clean();
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d H Y H:i:s').'GMT');
header('Cash-Control: no-cashe, must-revalidate');
header('Pragma: no-cashe');
header("Content-type: text/xml; charset=windows-1251");
$response="<response><descriptionImgGallery>фывфывфыв</descriptionImgGallery><nameImgGallery>фывфывфывфыввввввв</nameImgGallery></response>";
echo $response;
}
?>