dongsetan3216 2010-11-22 16:15
浏览 93
已采纳

uploadify firefox崩溃onsuccess响应警报

i am implementing uploadify on my web to upload photos, and i trigger a response on success, everything is running well on chrome and IE 8, but firefox crashed every time the response alert pops up, nothing can be clicked, i cant even close the alert or the firefox, while firefox is still running on task manager's process, is it the code or is it my firefox ??

here's my uploadify code:

$('#file_upload').uploadify({
    'uploader'          : '/apaapaapa/clientside/js/uploadify/uploadify.swf',
    'script'            : '/apaapaapa/backend_admin/processes/anak.php',
    'cancelImg'         : '/apaapaapa/clientside/js/uploadify/cancel.png',
    'fileExt'           : '*.jpg;*.gif;*.png',
    'fileDesc'          : 'Web Image Files (.JPG, .GIF, .PNG)',
    'multi'             : true,
    'queueSizeLimit'    : 5,
    onAllComplete       : function(event, ID, fileObj, response, data){
                                $('#responseUploadify').html(response);

                            },
    onError             : function (event,ID,fileObj,errorObj) {
                                $('#responseUploadify').html(response);
                            }

});

and here's my upload code:

if(!empty($_FILES)) {
    $number         = implode(random_activation_code(3));   
    $path_parts     = pathinfo($_FILES['Filedata']['name']);
    $ext            = $path_parts['extension'];

    if($ext == 'jpeg' || $ext == 'jpg' || $ext == 'gif' || $ext == 'png'){
        $page = 'kids';

        $pic = new Gallery();       
        $pic->attach_file($_FILES['Filedata'], $page, $number);
        $pic->created       = time();

        if($pic->save()){
            echo "Success!";
        }else{
            echo "Failed";
        }
    }else{
        echo "Ooops.... extension error";
    }   
}
  • 写回答

1条回答 默认 最新

  • duan7264 2010-11-22 17:44
    关注

    alert in the onComplete crash Firefox, it's normal... Display the response in a div.

    HTML :

    <div id="responseUploadify"></div>
    

    JS :

    onComplete          : function(event, ID, fileObj, response, data){
                                    $('#responseUploadify').html(response);
                                }
    

    Hope this help.

    PS: Sorry for my bad english ^^

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?