0
저는 프로토 타입을 처음 사용하기 시작했으며 개발중인 웹 사이트에서 여러 가지 것을 테스트하려고합니다. 그러나 나는 실수를해서 우연히 만났고 그 이유를 모르겠습니다. 전에 그 속성을 사용했기 때문에 작동했습니다.유형 프로토 타입을 사용할 때의 오류
나는 아직도 배우고, 더 숙련 된 자바 스크립트 개발자가 아닌 없지만, 여기에 내가 가진 무엇 :
var defaults = {
local_storage_key : "Cluster",
plugin_navigation : ".navigation",
plugin_wrapper : "content-wrapper",
iqns_class : ".iqn"
}
var Clusters = function(environment, options){
this.options = $.extend({}, defaults, options);
this.environment = environment;
this.viewport = $(window);
this.viewport_width = this.viewport.width();
this.viewport_height = this.viewport.height();
this.data_key = this.options.local_storage_key;
this.iqns_class = this.viewport.find(this.options.iqns_class);
this.iqn = this.iqns_class.parent();
this.shop_initiated = false;
this.plugin_navigation = this.options.plugin_navigation;
this.plugin_wrapper = this.options.plugin_wrapper;
this.initiate_plugin(this.plugin_navigation, {
containerID : this.plugin_wrapper,
first : false,
previous : false,
next : false,
last : false,
startPage : this.get_local_storage_data(),
perPage : 6,
midRange : 15,
startRange : 1,
endRange : 1,
keyBrowse : false,
scrollBrowse: false,
pause : 0,
clickStop : true,
delay : 50,
direction : "auto",
animation : "fadeInUp",
links : "title",
fallback : 1000,
minHeight : true,
callback : function(pages) {
this.set_local_storage_data(pages.current);
}
});
this.initiate_auxiliars();
this.set_environment();
};
Clusters.prototype.set_local_storage_data = function(data_val) {
return localStorage.setItem(this.data_key, data_val);
};
Clusters.prototype.get_local_storage_data = function() {
return +(localStorage.getItem(this.data_key) || 1);
};
Clusters.prototype.shop_iqns_selected_class = function() {
var self = this;
if (this.viewport_width < 980) {
$(this.iqns_class).each(function(index, element) {
var element = $(element);
$(self.iqn).on('click', function() {
if (element.hasClass('selected')) {
element.removeClass('selected');
} else {
element.addClass('selected');
}
});
});
}
}
Clusters.prototype.initiate_plugin = function(plugin_navigation, plugin_options) {
return $(plugin_navigation).jPages(plugin_options);
}
Clusters.prototype.initiate_auxiliars = function() {
return this.shop_iqns_selected_class();
}
Clusters.prototype.set_environment = function() {
if(this.environment == "Development") {
less.env = "development";
less.watch();
}
}
var cluster = new Clusters("Development");
나는 때문에, 그렇지 않으면, 내가 잘못 또는 프로토 타이핑에 대한 오해하고있어 뭔가가있을거야 나는 어떤 오류도 내지 않을 것이다. 나는 내가하고있는 일에 대한 몇 가지 의견이나 몇 가지 지시를 요구하고 있으며, 내가해야 할 일과해야 할 일은하지 말아야한다.
Uncaught TypeError: Object #<Object> has no method 'set_local_storage_data' on line 53