Jcrop在特定服务器上的IE8下失败,可以在另一台服务器上运行

时间:2013-07-10 20:49:58

标签: javascript jquery jcrop

在我们的登台服务器上遇到Jcrop失败但在生产中工作正常的问题。

两个环境都在相同的硬件上运行,设置了apache虚拟主机。从我们可以看出,环境是相同的。以下是选择要上传的图片后加载的模式框中的代码。

<?php $jsIncludes = array(
    "jQuery-File-Upload-and-Crop-plugin/js/vendor/jquery.ui.widget",
    "jQuery-File-Upload-and-Crop-plugin/js/jquery.iframe-transport",
    "jQuery-File-Upload-and-Crop-plugin/js/jquery.Jcrop",
    "jQuery-File-Upload-and-Crop-plugin/js/canvas-to-blob.min",
    "jQuery-File-Upload-and-Crop-plugin/js/load-image.min",
    "jQuery-File-Upload-and-Crop-plugin/js/main"
    );
echo $this->html->script($jsIncludes); 
?>
<link rel="stylesheet" href="/js/jQuery-File-Upload-and-Crop-plugin/css/jquery.Jcrop.css" type="text/css" />
<!-- CSS to make adjusments to some layouts of JQ FURAC -->
<link rel="stylesheet" href="/js/jQuery-File-Upload-and-Crop-plugin/css/jquery.furac.ui.css"> 
<style>
.modal-image-scroll {
    height:420px;
    overflow:auto;
    overflow-x:hidden;
}
</style>

<!-- modal-gallery is the modal dialog used for the image gallery -->
<div id="modal-gallery" class="modal modal-gallery hide fade" data-filter=":odd">
    <div class="modal-header">
        <a class="close" data-dismiss="modal">&times;</a>
        <h3 class="modal-title">Image Upload and Crop</h3>
    </div>
    <div class="modal-body"><div class="modal-image"></div></div>
    <div class="modal-footer">
        <form id="opCrop">
<!--            <button class="btn modal-crop" type="button" id="startResize">
                <i class="icon-resize-horizontal"></i>
                Resize to:
            </button> -->
            <a class="btn modal-crop" target="_blank" id="startCrop">
                <i class="icon-th"></i>
                <span>Crop Image to:</span>
            </a>
            <label for="inWidthCrop">Width</label> <input type="number" readonly name="widthCrop" id="inWidthCrop" value="">
            <label for="inHeightCrop">Height</label> <input type="number" readonly name="heightCrop" id="inHeightCrop" value="">

<!--             <button type="reset" class="btn btn-warning cancel">
                    <i class="icon-ban-circle icon-white"></i>
                    Clear
                </button> -->
        </form>
    </div>
</div>
<!-- modal for cropping -->
<div id="croppingModal" class="modal hide">
    <div class="modal-header">
        <button type="button" id="btnCloseCrop" class="close" data-dismiss="modal">×</button>
        <h3>Crop Image <span class="dimentions"></span></h3>
    </div>
    <div class="modal-body">

    </div>
    <br />
    <div class="alert alert-info" style="font-size: 12px; padding: 4px 10px 4px 10px;">
        Click and drag over the area of the phone you'd like to use as your profile picture.
    </div>
    <div class="modal-footer">
        <a href="#" class="btn closeModal" data-dismiss="modal" id="btnCancelCrop">Cancel</a>
        <a href="#" class="btn btn-primary" id="btnDoCrop">Crop</a>
    </div>
</div>

任何人都知道为什么这可能适用于一个环境但不适用于另一个环境?

该网站正在使用此库: https://github.com/baamenabar/jQuery-File-Upload-and-Crop

我们最终在IE8下的暂存环境中得到的是一张正确裁剪的图像,但无论源图像如何,它都是黑色的。

1 个答案:

答案 0 :(得分:0)

这是一个古老的悬而未决的问题,但万一有人来自Google搜索,答案就是不必担心IE8。死了如果客户需要IE8支持,请向客户显示一条消息,告知他们需要下载现代浏览器。