You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Актуальные контакты:
Telegram: @Nikker_web
E-Mail: tarasevich.email@gmail.com
Портфолио https://www.behance.net/d4d4186e
Разрабатываю дизайн групп в соц сетях, сайтов, приложений, другой дизайн под заказ
Актуальные контакты:
Telegram: @Nikker_web
E-Mail: tarasevich.email@gmail.com
Разрабатываю дизайн групп в соц сетях, сайтов, приложений, другой дизайн под заказ
Портфолио https://www.behance.net/d4d4186e
Question
WolF™
Здравствуйте! Приходится делать сайт с поддержкой ослов (IE). Ошибка заключается в моем объекте, если не сложно, подскажите где..
var ParseHash = function() {$(window).hashchange(function() {
this.hash = location.hash.replace(/#/, "").split("&");
if(!this.hash[0]) this.hash = [];
if(this.onhc) this.onhc([this.hash, location.hash])
} .bind(this));
$(window).hashchange();
this.select = function(a) {
var b = !1;
jQuery.each(this.hash, function(d, c) {
if(c.split("=")[0] == a) return b = c.split("=")[1], !1
});
return b
};
this.set = function(set) {
var add = function(arr) {
if(this.hash[0] && this.select(arr[0])) {
jQuery.each(this.hash, function(i, val) {
if(val.split('=')[0] == arr[0]) {
this.hash[i] = [arr[0], arr[1]].join('=');
}
} .bind(this));
} else {
this.hash.push([arr[0], arr[1]].join('='));
}
} .bind(this);
if(arguments[1]) {
add([set, arguments[1]]);
} else {
for(var key in set) {
add([key, set[key]]);
}
}
this.sync();
};
this.del = function(key) {
if(arguments[1]) {
jQuery(this.hash, function(i, val) {
if(val && val.split('=')[1] == key) {
delete this.hash[i];
}
} .bind(this));
} else {
jQuery.each(this.hash, function(i, val) {
if(val && val.split('=')[0] == key) {
delete this.hash[i];
}
} .bind(this));
}
this.sync();
};
this.sync = function() {
var h = [];
for(var i = 0; i < this.hash.length; i++) {
if(i in this.hash) {
h.push(this.hash[i])
}
}
this.hash = h;
this.hash.sort();
location.hash = this.hash.join('&');
};
}
P.S: Сайт полностью на Ajax'e. С отключенным JS переходит в обычный режим. Буду очень рад ответу)
P.P.S: После этого кода IE отказывается вызывать даже alert..
P.P.P.S: Используется jQuery последней версии и JQuery.onhashchange plugin (первая ссылка в Google (дабы без рекламы))
Edited by WolF™Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.