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?
anyone have any ideas?Code: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+"°="+degrees; ajaxRequest.open("GET", php, true); ajaxRequest.send(null); } else { alert("Rotation Cancled"); } }



Reply With Quote

Bookmarks