0

我有这样的反对:

Object {mime: "image/png", ts: 1372704010, read: 1, write: 1, size: 452343…}
baseUrl: "http://davosovo/images/"
date: "1 Jul 2013 20:40"
dim: "960x400"
hash: "l1_YXBwc1xtb2plLXR2b3JiYS5wbmc"
height: "400"
mime: "image/png"
name: "moje-tvorba.png"
path: "images\apps\moje-tvorba.png"
phash: "l1_YXBwcw"
read: 1
size: 452343
tmb: "http://davosovo/images/.tmb/l1_YXBwc1xtb2plLXR2b3JiYS5wbmc1372704010.png"
ts: 1372704010
url: "http://davosovo/images/apps/moje-tvorba.png"
width: "960"
write: 1

我想要path财产。但它写道我undefined已经尝试过这样的循环:

for (var key in file) {
console.log(key + ':' + file[key]);
}

它给了我这个:

mime:image/png
ts:1372704010
read:1
write:1
size:452343
hash:l1_YXBwc1xtb2plLXR2b3JiYS5wbmc
name:moje-tvorba.png
phash:l1_YXBwcw
date:1 Jul 2013 20:40
tmb:l1_YXBwc1xtb2plLXR2b3JiYS5wbmc1372704010.png

怎么了?

var elfinder = function(callback) {
            jQuery('<div />').dialogelfinder({
                url : '<?= SystemInfo::getDomainUrl() ?>/modules/elrte/php/connector.php',
                lang : '<?= $lang ?>',
                allowShortcuts : false,
                handlers : {
                    select : function (event, elfinderInstance) {
                        var selected = event.data.selected;

                        if (selected.length) {
                            var file = elfinderInstance.file(selected[0]);
                            console.log(file);
                            for (var key in file) {
                                console.log(key + ':' + file[key]);
                            }
                        }
                    },
                    dblclick: function(event, elfinderInstance) {

                    }
                },
                getFileCallback: callback // pass callback to file manager
            });
        }
4

0 回答 0