Results 1 to 3 of 3

Thread: Any clues why this doesnt work in firefox?

  1. #1
    Join Date
    Nov 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Any clues why this doesnt work in firefox?

    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?

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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Nov 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default never mind

    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)
    Last edited by aseaofflames; 11-09-2007 at 01:23 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •