Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何裁剪从ajax获取的图像?_Php_Jquery_Ajax - Fatal编程技术网

Php 如何裁剪从ajax获取的图像?

Php 如何裁剪从ajax获取的图像?,php,jquery,ajax,Php,Jquery,Ajax,如何裁剪从ajax获取的图像 function showDeletePopup(id) { $.ajax({ type: "POST", url: "ajax.php", }).done(function (data) { $('#simplediv').html(data); }); } 我使用从ajax获得的代码裁剪图像,但图像无法裁剪。。。。? 我无法使用imageareaselect选择图像。 如果不使用ajax图像显示,裁剪代码将在其上工作。ajax.p

如何裁剪从ajax获取的图像

function showDeletePopup(id)
{
 $.ajax({
    type: "POST",
    url: "ajax.php",

}).done(function (data) {
    $('#simplediv').html(data);
});

}
我使用从ajax获得的代码裁剪图像,但图像无法裁剪。。。。? 我无法使用imageareaselect选择图像。
如果不使用ajax图像显示,裁剪代码将在其上工作。

ajax.php返回什么?什么类型的内容?是链接吗?包括ajax.php的源代码。您肯定应该使用get而不是post来调用ajax吗?只是一个图像名称,我们不能在该图像中应用图像区域选择。。。。
<script type="text/javascript">
$( document ).ready(function() {
$(function(){
    $('.1').Jcrop({
    aspectRatio: 1,
    onSelect: updateCoords
    });

});
});
function updateCoords(c)
{
    $('#x').val(c.x);
    $('#y').val(c.y);
    $('#w').val(c.w);
    $('#h').val(c.h);
};

function checkCoords()
{
    if (parseInt($('#w').val())) return true;
    alert('Please select a crop region then press submit.');
    return false;
};
</script>
<form action="index.php" method="post" onSubmit="return checkCoords();">
      <input type="hidden" id="x" name="x" />
      <input type="hidden" id="y" name="y" />
      <input type="hidden" id="w" name="w" />
      <input type="hidden" id="h" name="h" />
      <input type="submit" value="Crop Image" class="btn btn-large btn-inverse" />
    </form>
<div id="simplediv" ></div>