0

我遇到了这个非常奇怪的错误,我不知道如何处理它。我的设置是一个页面,我可以在其中选择一个图像文件(gears beta.desktop),然后它应该上传。但它没有上传,并给出了一个我无法摆脱的非常奇怪的错误。下面是我的代码:

var filesToUpload = null;

        function progressEvent(event) {
            var bar = $("#progressBar");
            var percentage = Math.round((event.loaded / event.total) * 100);

            bar.width(percentage + '%');
        }

        function uploadState() {
            if(request.readyState == 4) {
                if(request.status != 200) {
                    alert('ERROR');
                } else {
                    alert('DONE');
                }
            }
        }

        function handleFiles(files) {
            if(files.length) {
                $('#loader').slideDown(500);
                var curFile = files[0];

                request.open('POST', 'upload.php');
                request.setRequestHeader("Content-Disposition", "attachment; filename=\"" + curFile.name + "\"");
                request.onreadystatechange = uploadState;
                request.upload.onprogress  = progressEvent;

                request.send(curFile.blob);
            }
        }

        init = function() {
            if(!window.google || !google.gears) {
                $('body').css('background', 'white');
                $('#gearsOn').hide();
                $('#gearsOff').show();
                return;
            }

            // verberg 'geen gears' bericht
            $('#gearsOff').hide();

            // init upload zooi (gears)
            desktop = google.gears.factory.create('beta.desktop');
            request = google.gears.factory.create('beta.httprequest');


            // on click funct
            $('#titel').click(function() {
                var newtitle = prompt("Voer een titel in voor het album.");

                if(newtitle != '' && newtitle != null) {
                    $(this).text(newtitle);
                }
            });

            $('.addPictures').click(function() {
                filesToUpload = null;
                var options = { singleFile: true, filter: [ 'image/jpeg', 'image/png'] };
                desktop.openFiles(handleFiles, options);
            });
        };

        $(document).ready(init);

它给出了以下错误:

[Exception... "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsILoadGroup.groupObserver]" nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)" location: "JS frame :: file:///Users/Fabian/Library/Application%20Support/Firefox/Profiles/oo132cjy.default/extensions/%7Be3f6c2cc-d8db-498c-af6c-499fb211db97%7D/components/componentCollectorService.js :: anonymous :: line 1155" data: no]
[Break on this error] obj = getIface(request.loadGroup.groupObserver);

在这个位置可以看到东西:Dynamics Photo

提前致谢!!

4

2 回答 2

1

当我使用页面速度时出现此错误 - firebug 的扩展。如果您使用相同的尝试停用此扩展程序。

于 2009-08-18T10:51:41.210 回答
0

禁用页面速度没有帮助......所以卸载了扩展......它可以工作

于 2010-01-27T22:59:32.067 回答