|
|
|
| Добрый день. Имеется следующий код, но он не работает в IE и Mazillla, как подправить что бы заработа?
<html>
<body>
<form aciton="javascript:SendForm()">
....
</form>
</body>
</html>
<script type="text/javascript">
function GetXMLHttp() {
var xmlhttp;
try
{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(E)
{
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') xmlhttp = new XMLHttpRequest();
return xmlhttp;
}
var CURLObj = GetXMLHttp();
function SendForm()
{
CURLObj.open( 'POST','?p=MyPage&NoCache='+Math.random() );
CURLObj.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' );
CURLObj.onreadystatechange = function() {
if( CURLObj.readyState == 4 )
{
alert( 'OK!' );
}
}
CURLObj.send( 'param1=123¶m2=321' );
}
</script>
|
| |
|
|