- 1
- 2
- 3
if(e.password == '23f9dg'){
$('#editable').show(0);
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+177
if(e.password == '23f9dg'){
$('#editable').show(0);
}
Клиентский JS, упоротым под баклофеном лучше не кодить...
+153
if ((this.formType.urlParam === 'sell1') || (this.formType.urlParam === 'supply1')) {
url = 'sell-return-list';
} else if ((this.formType.urlParam === 'sell2') || (this.formType.urlParam === 'supply2')) {
url = 'buy-return-list';
} else if ((this.formType.urlParam === 'service1') || (this.formType.urlParam === 'service2')) {
url = 'get-service-list';
} else {
url = 'provide-service-list';
}
Ниньзя стайл
+154
if(Math.round(Math.random()*10)==7){
alert('Your name/lastname alredy used! Try other.');
}
Валидация форм, чё
+157
onChange: function (el, e) {
var val = el.val();
if (val.substring(8, 10) === " ") {
this.setValue(val.substring(0, 6) + "20" + val.substring(6, 8));
}
this.setValue(val === "" ? null : val);
}
Обработчик onChange в дейтпикере
нинзя-разработчик 16 levl
+148
$("#select_id :selected").attr("selected", false);
$("#select_id option[value='" + new_value + "']").attr("selected", true);
вместо
$("#select_id").val(new_value);
+154
function isEmptyStr(val) {
return val == null || val === "";
}
+154
function reNumberAreas(parent)
{
for (i=0;i<parent.childNodes.length;i++)
{
try
{
parent.childNodes[i].firstChild.firstChild.firstChild.firstChild.id = cutNumber(parent.childNodes[0].firstChild.firstChild.firstChild.firstChild.id) + i;
parent.childNodes[i].firstChild.firstChild.firstChild.firstChild.nextSibling.nextSibling.id = parent.childNodes[i].firstChild.firstChild.firstChild.firstChild.id + "_text";
parent.childNodes[i].firstChild.firstChild.firstChild.firstChild.nextSibling.nextSibling.nextSibling.src = parent.childNodes[i].firstChild.firstChild.firstChild.firstChild.nextSibling.nextSibling.nextSibling.src.replace(/index=\d+/g,"index=" + i);
}
catch (e)
{
}
}
}
Форматирование кода сохранено для придания драматичности.
+141
<div onclick="javascript: fun1();" style="position:absolyte; z-index:1;" id="div1">text</div>
+158
$(window).load(function() {
if ($(window).height() < 587) {
$('#inquiry').css({'position' : 'relative','margin-top' : -511,'top' : 0});
}
$(document).ready(function() {
$(function() {
if ($.browser.msie && $.browser.version >= 7) {
$('.ask').click(function() {
$('#inquiry').css({'display' : 'block'});
$('#inquiry_pop').css({'display' : 'block'});
});
$('#close_iq').click(function() {
$('#inquiry').hide();
$('#inquiry_pop').hide();
});
$('.sub_fo').click(function() {
$('#inquiry, #inquiry_pop').hide(0);
$('#thank_you').delay(500).show(0);
$('#thank_you').delay(3000).hide(0);
});
} else {
$('.ask').click(function() {
$('#inquiry, #inquiry_pop').fadeIn(1500);
});
$('#close_iq').click(function() {
$('#inquiry, #inquiry_pop').fadeOut(1500);
});
$('.sub_fo').click(function() {
$('#inquiry, #inquiry_pop').fadeOut(1500);
$('#thank_you').delay(500).fadeIn(1500);
$('#thank_you').delay(3000).fadeOut(1500);
});
}
});
});
});
+157
for (var inc = 0; inc < 100; inc++){
var key = Math.random();
client.set(inc, Math.random(), function(){
client.get(inc, function(val){
console.log(inc);
})
});
}
"Какого хуя мне 100 раз по 100 возвращается?"
Спросил у меня утром знакомый и отправил этот код.