Hi,
This is what the ajax part of your script is doing:
When the cropping ends and the user confirms they want to save the image, it is firing off a GET request to the file ajax_image.php, passing it a load of parameters in a query string.
type:"GET",
url:"ajax_image.php?id=1&t=ajax&img="+$("#image_name").val()+"&w="+thumb_width+"&h="+thumb_height+"&x1="+x_axis+"&y1="+y_axis,
The complete address looks like (taken from Chrome console):
http://miamiproviders.com/cropimages/ajax_image.php?id=1&t=ajax&img=undefined&w=124&h=124&x1=231&y1=111&_=1383853271290
It’s turning off caching for this particular request.
cache:false,
Then it’s specifying a success callback that will be executed if the AJAX request is successful (which it is, as you can tell by the 200 response code)
success:function(rsponse){
$("#cropimage").hide();
$("#thumbs").html("");
$("#thumbs").html("<img src='../providers/images/1/"+rsponse+"' />");
}
This callback takes one parameter, which is the server’s response.
This appears to be a string, containing the name of a file: feature.jpg
It then hides the element with the id of “cropimage” and empties the element with the id “thumbs”.
After that it creates an <img>
tag, setting its src
attribute to a path relative to your script, concatenated with the server’s response (e.g. ‘…/providers/images/1/feature.jpg’)
It then inserts this image tag into the element into the element with the id of “thumbs”
It seems at this point that your JavaScript is doing what is expected and that the problem lies with your PHP script which should be saving a cropped image on your file system, but isn’t.