Javascript-форум (https://javascript.ru/forum/)
-   Общие вопросы Javascript (https://javascript.ru/forum/misc/)
-   -   prevObject: x.fn.x.init[1] (https://javascript.ru/forum/misc/45295-prevobject-x-fn-x-init%5B1%5D.html)

niko42 22.02.2014 17:48

prevObject: x.fn.x.init[1]
 
function UK(){

    var cached = {
        cacheListCatalog : false
    };

    var method = {
        removeListCategory : function(){
            console.log(cached.cacheListCatalog);
            console.log($(".installCatalog ul li"));
        }
    };
	
	var category = {
        install : function(){
            method.removeListCategory();
        }
    };

    return {
        init : function(){
            cached.cacheListCatalog = $(".installCatalog ul li");
            return $.extend(category);
        }
    }
}

var UK = UK().init ();
UK.category()


Console:
Это cacheListCatalog: [prevObject: x.fn.x.init[1], context: document, selector: ".installCatalog ul li", jquery: "2.0.3", constructor: function…]

Это $(".installCatalog ul li") если обращаться на прямую: [li, li, prevObject: x.fn.x.init[1], context: document, selector: ".installCatalog ul li", jquery: "2.0.3", constructor: function…]


Хочу сохранить состояние дерева все что находится внутри тега li - в переменную cached.cacheListCatalog

Но, к сожалению, он не сохраняет. Подскажите, пожалуйста, в чем причина?

niko42 22.02.2014 19:00

Разобрался. В итоге сохраняет пустоту, т.к. дерево еще не сформурованно


Часовой пояс GMT +3, время: 14:43.