- 1
$('.menu-left li:last').parent().parent().attr('class', $('#menu-menu_building li:last').parent().parent().attr('class')+' last');
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+167
$('.menu-left li:last').parent().parent().attr('class', $('#menu-menu_building li:last').parent().parent().attr('class')+' last');
К классу последнего li главного ul в выпадающем списке добавляется 'last'.
+149
function returnFalse() {
return false;
}
function returnTrue() {
return true;
}
Не знаю, может было.
Нашел в jquery http://code.jquery.com/jquery-1.6.2.js
Может я не шарю, но зачем?
+158
A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.
Script: http://govnokod.ru/media/d10c81f141cf62e45d6f8dba139fa72d.js?files=jquery.js,govnokod.js,livecomments.js,jshighlight/highlight.pack.js&v=4:452
Говнокод в govnokod e.
+150
function Point(){
this.x = 0;
this.y = 0;
if(arguments.length==2){ //if parameters are 2 points
this.x = arguments[0] || 0;
this.y = arguments[1] || 0;
}else
if(arguments.length==1){ //if parameter is a point object
this.x = arguments[0].x;
this.y = arguments[0].y;
}
};
+171
$('#bc8').html('<style type="text/css">#bc8 {display:none;}</style>');
$('#bc7').html('<style type="text/css">#bc7 {display:none;}</style>');
$('#bc12').html('<style type="text/css">#bc12 {display:none;}</style>');
$('#bc16').html('<style type="text/css">#bc16 {display:none;}</style>');
$('#bc18').html('<style type="text/css">#bc18 {display:none;}</style>');
$('#bc17').html('<style type="text/css">#bc17 {display:none;}</style>');
$('#bc9').html('<style type="text/css">#bc9 {display:none;}</style>');
Хороший jQuery-программист
+174
var reps = 2
var speed = 500
var message = '0';
var p='15';
var T="";
var C=0;
var mC=0;
var s=0;
var sT=null;
if(reps<1)reps=1;
function doTheThing(){
T=message[mC];
A();}
function A()
{
s++
if(s>15){s=1}
if(s==1){document.title='W'}
if(s==2){document.title='WE'}
if(s==3){document.title='WEL'}
if(s==4){document.title='WELC'}
if(s==5){document.title='WELCO'}
if(s==6){document.title='WELCOM'}
if(s==7){document.title='WELCOME'}
if(s==8){document.title='WELCOME T'}
if(s==9){document.title='WELCOME TO'}
if(s==10){document.title='WELCOME TO M'}
if(s==11){document.title='WELCOME TO MY'}
if(s==12){document.title='WELCOME TO MY S'}
if(s==13){document.title='WELCOME TO MY SI'}
if(s==14){document.title='WELCOME TO MY SIT'}
if(s==15){document.title='WELCOME TO MY SITE'}
if(C<(8*reps)){
sT=setTimeout("A()",speed);
C++
}else{
C=0;
s=0;
mC++
if(mC>p-1)mC=0;
sT=null;
doTheThing();}}
doTheThing();
Накопал на древнем сайте по веб-дизайну, какого то самоучки )
ощущение что делалось чтобы показать как не надо делать , но лежало без подписей вообще
+164
function withoutCyr(inрut) {
var value = inрut.value;
var re = /а|б|в|г|д|е|ё|ж|з|и|й|ё|к|л|м|н|о|п|р|с|т|у|ф|х|ц|ч|ш|щ|ъ|ы|ь|э|ю|я/gi;
if (re.test(value)) {
value = value.replace(re, '');
inрut.value = value;
}
}
+179
jQuery.atmosphere.request.transport = 'polling';
if (jQuery.atmosphere.request.transport != 'websocket') {
jQuery.atmosphere.executeRequest();
} else if (jQuery.atmosphere.request.transport == 'websocket') {
// ..
}
Сразу удар по двум яйцам.
Сначала говорим, что transport = 'polling', а потом проверяем, не равен ли он случайно 'websocket'
Второй удар - обычный else использовать, видимо, было не прикольно. Или у транспорта кроме "равен websocket" и "не равен websocket" может быть третье состояние? ;)
Код актуальный и на данный момент присутствует в официальном репозитории, пруф: https://github.com/jfarcand/atmosphere/blob/master/modules/jquery/src/main/webapp/jquery/jquery.atmosphere.js#L493-503
пс. А мы на работе удивляемся, почему 'websocket' у них не работает)
+175
<h2>
<script>
var date = new Date();
var lefttime = 31 - date.getDate();
var day = ['дней','день','дня','дня','дня','дней','дней','дней','дней','дней','дней','дней','дней','дней','дней','дней','дней','дней','дней','дней','дней','день','дня','дня','дня','дней','дней','дней','дней','дней','дней','день'];
document.write('Чаты@Mail.Ru закрываются через ' + lefttime + ' ' + day[lefttime]);
</script>
Чаты@Mail.Ru закрываются через 30 дней
</h2>
Баннер на входе в чат мэйл ру с предупреждением о закрытии.
1 августа счетчик обнулился и пошел считать заново.
Зацените перечисление падежей для дней.
+161
console.loh(this);