View Full Version : Any clues why this doesnt work in firefox?

11-05-2007, 03:58 AM
this script uses ajax to call a php script to rotate an image. My question is: why does it work in ie but not in firefox?

function rotate(filename) {
var degrees = prompt("Number of Degrees To Rotate:", "90");
if(degrees) {
var ajaxRequest; // The variable that makes Ajax possible!

// Opera 8.0+, Firefox, Safari
ajaxRequest = new XMLHttpRequest();
} catch (e){
// Internet Explorer Browsers
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e){
// Something went wrong
alert("Your browser broke!");
return false;
// Create a function that will receive data sent from the server
ajaxRequest.onreadystatechange = function(){

if(ajaxRequest.readyState == 4){
var rc = ajaxRequest.responseText.replace(/(<([^>]+)>)/ig,"");
var host = window.location.hostname;
var image = '<img src="http://"+host+"/thumbnail.php?gd=2&maxw=450&src=site/includes/images/temp/'+filename+'">';
document.getElementById('image2').innerHTML = image;
var php = "includes/rotate.php?file="+filename+"&deg="+degrees;
ajaxRequest.open("GET", php, true);
} else {
alert("Rotation Cancled");

anyone have any ideas?

11-05-2007, 03:12 PM
Looks reasonable, what's the problem? I mean are there any error messages?

Please post a link to the page on your site that contains the problematic code so we can check it out.

11-09-2007, 01:17 AM
its part of a file hosting site:


click login

username: test
password: test

click my files (in menu on left)
click images (under limit)
choose an image and click manipulate
click rotate

a box shows up asking how many degrees to rotate, but after that, nothing happens in firefox
(like i said before, it works fine in internet explorer)