PDA

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



aseaofflames
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!

try{
// Opera 8.0+, Firefox, Safari
ajaxRequest = new XMLHttpRequest();
} catch (e){
// Internet Explorer Browsers
try{
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try{
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,"");
alert(rc);
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);
ajaxRequest.send(null);
} else {
alert("Rotation Cancled");
}
}

anyone have any ideas?

jscheuer1
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.

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

http://www.dropbox.uni.cc/site/

click login

credentials:
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)