Chrome中的Uploadify返回Aw,Snap页面 [英] Uploadify in Chrome return Aw, Snap page

查看:129
本文介绍了Chrome中的Uploadify返回Aw,Snap页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从上次更新的铬(版本36.0.1985.125米)我有uplodify插件/闪存的问题。 Chrome显示Aw,Snap Page或者有时他已经死了,Jim!这里是我的uplodify代码:

 < input type =filename =file_uploadid =file_upload_50> 
< script type =text / javascript>
var basePath =资源路径;
var errorMessage =错误消息;
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':上传,
'fileTypeExts ':allowExts,
'fileTypeDesc':格式:+ allowExts,$ b $'formData':{$ b $'user_id':50,$ b $'company_id':1 $ b $函数(file,errorCode,errorMsg,errorString){
alert(errorMessage);
is_error = true;
},
',
'onUploadError' onUploadSuccess':function(file,data,response){
var result = $ .parseJSON(data);
if(!result.result){$ b $ alert(result.error_msg);
is_error = true;
}
},
'onQueueComplete :函数(queueData){
如果(!is_error){
document.location.href = result_page.html;
}
}
});
});
< / script>

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

解决方案

我发现添加一个 setTimeout 这将表明Chrome / Chrome的Flash实现/ Uploadify的Flash应用程序中的竞争状况,其环境不明确。但是,它似乎在我们的用例的所有情况下工作。

  $(document).ready(function(){
setTimeout(function(){
$('foo')。uploadify({...});
},0);
});

这不是一个好的答案,但是在没有解决方案,这是一个可用的解决方法。


from last update of chrome (Version 36.0.1985.125 m) i have problem with uplodify plugin/flash. Chrome shows Aw, Snap Page or sometimes He's Dead, Jim!. Here is my uplodify code:

<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>

Where is the problem? Can you get me some advice. I am helpless. Thanks

解决方案

I've found that adding a setTimeout fixes this. This would indicate a race condition in Chrome / Chrome's Flash implementation / Uploadify's Flash app, the circumstances of which are not clear. Nonetheless, it appears to work in all situations for our use case.

$(document).ready(function () {
    setTimeout(function () {
        $('foo').uploadify({...});
    }, 0);
});

This isn't a good answer, but in the absence of a solution, it's a usable workaround.

这篇关于Chrome中的Uploadify返回Aw,Snap页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆