Hello,
I am using a database to access with a simple ajax script
see following example
<script type="text/javascript">
$(document).ready(function() {
// start slideshow
$('#content1').cycle({
fx: 'curtainX',
timeout: 2000,
before:MakeRequest()
});
});
</script>
</head>
<body>
<div id="content1" class="content1">
<img src="image1.png">
<img src="image2.png">
</div>
ajax script
function getXMLHttp()
{
var xmlHttp
try
{
//Firefox, Opera 8.0+, Safari
xmlHttp = new XMLHttpRequest();
}
catch(e)
{
//Internet Explorer
try
{
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e)
{
alert("Your browser does not support AJAX!")
return false;
}
}
}
return xmlHttp;
}
function MakeRequest()
{
var xmlHttp = getXMLHttp();
xmlHttp.onreadystatechange = function()
{
if(xmlHttp.readyState == 4)
{
HandleResponse(xmlHttp.responseText);
}
}
xmlHttp.open("post", "_php/gastenboek.php", true); <== is this the problem ?
xmlHttp.send(null);
}
function HandleResponse(response)
{
document.getElementById('content1').innerHTML = response;
}
php code gastenboek.php opens a very simple database with picture names
This works for google chrome but not for firefox or IE ,they just display the pictures sequential
any ideas ?
By the way I have changed
xmlHttp.open("post", "_php/gastenboek.php", true); true to false
xmlHttp.open("post", "_php/gastenboek.php", false);now it is working for ie
but firefox still give a problen