加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – 在Chrome中Uploadify返回Aw,Snap页面

发布时间:2020-12-13 17:35:08 所属栏目:PHP教程 来源:网络整理
导读:从最后更新的chrome(版本36.0.1985.125 m)我有uplodify插件/闪存的问题. Chrome显示Aw,Snap页面或有时他死了,Jim!这是我的uplodify代码: input type="file" name="file_upload" id="file_upload_50"script type="text/javascript"var basePath = "path to
从最后更新的chrome(版本36.0.1985.125 m)我有uplodify插件/闪存的问题. Chrome显示Aw,Snap页面或有时他死了,Jim!这是我的uplodify代码:
<input type="file" name="file_upload" id="file_upload_50">
<script type="text/javascript">
var basePath = "path to ressources";
var errorMessage = "Error Message";
var allowExts = "*.pdf; *.xls; *.xlsx; *.rar; *.zip";
$(document).ready(function() {
    var is_error = false;
    $('#file_upload_50').uploadify({
        'swf': basePath + '/uploadify/uploadify.swf','uploader': "uploader.php",'height': 25,'buttonText': "Upload",'fileTypeExts': allowExts,'fileTypeDesc': "Formats:" + allowExts,'formData': {
            'user_id': 50,'company_id': 1
        },'onUploadError': function(file,errorCode,errorMsg,errorString) {
            alert(errorMessage);
            is_error = true;
        },'onUploadSuccess': function(file,data,response) {
            var result = $.parseJSON(data);
            if (!result.result) {
                alert(result.error_msg);
                is_error = true;
            }
        },'onQueueComplete': function(queueData) {
            if (!is_error) {
                document.location.href = "result_page.html";
            }
        }
    });
});
</script>

哪里有问题?你能给我一些建议吗我很无奈谢谢

我发现添加一个setTimeout来修复这个.这表示Chrome / Chrome的Flash实施/ Uploadify的Flash应用程序中的竞争条件,其中的情况并不明确.尽管如此,它似乎在所有情况下都适用于我们的用例.
$(document).ready(function () {
    setTimeout(function () {
        $('foo').uploadify({...});
    },0);
});

这不是一个很好的答案,但是在没有解决方案的情况下,这是一个可用的解决方法.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读