1. JavaScript / Говнокод #7071

    +147

    1. 1
    if(typeof n!="number"&&(k==Number||!(n instanceof Number))||p.round(n)!=n||n==NaN||n==Infinity)return!1;

    yasosiska, 27 Июня 2011

    Комментарии (4)
  2. JavaScript / Говнокод #7070

    +147

    1. 1
    var yagooduser = sustr('Мой',1);

    Чел прислал в асю и удивляется, почему не работает

    yasosiska, 27 Июня 2011

    Комментарии (5)
  3. JavaScript / Говнокод #7064

    +160

    1. 1
    2. 2
    3. 3
    uWeb_b = function(text,cl,onclick,width){return '<div style="width:'+width+'px" class='+cl+' onclick='+onclick+' id="uWeb_Button">'+text+'</div>';}
    uWeb_b2 = function(text,cl,onclick,width){return '<div style="width:'+width+'px" class='+cl+' onclick='+onclick+' id="uWeb_Button2">'+text+'</div>';}
    uWeb_b3 = function(text,cl,onclick,width){return '<div style="width:'+width+'px" class='+cl+' onclick='+onclick+' id="uWeb_Button3">'+text+'</div>';}

    stuffort, 26 Июня 2011

    Комментарии (3)
  4. JavaScript / Говнокод #7049

    +159

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    jQuery("select[id='select1']").change(
    			function () 
    			{
    				var city_id = jQuery(this).attr("value");
    				jQuery("select[id='select_hotel']").html('<option>Выберите категорию</option>');
    				jQuery("select[name='room']").html('<option>Выберите категорию и отель</option>');
    				
    				jQuery("select[id='select_5']").change(
    					function () 
    					{
    						....................................
    					}
    				);			
    			}
    		);

    обратите внимание на то, как селекторы объектов написаны.. автор вместо "#select1" пишет "select[id='select1']" зачем это делать непонятно.
    наговнокодено на сайте el-tour.com

    magistr_bender, 24 Июня 2011

    Комментарии (7)
  5. JavaScript / Говнокод #7042

    +170

    1. 1
    2. 2
    3. 3
    (function(a){ var m
        return (m=a.length)<2 ? a[0] : (m=a[--m],a.length--,(a[a.length-1]>m)&&(a[a.length-1]=m),arguments.callee(a))
    })(this.prop)

    Вроде бы ищет минимум в this.prop.
    P.S. this.prop как массив удаляется. Равен результату.

    Jean-Esther, 24 Июня 2011

    Комментарии (4)
  6. JavaScript / Говнокод #7015

    +171

    1. 1
    var e=("article,aside,footer,header,nav,section").split(',');

    Найдено в дебрях одного сайта.

    lucidfox, 21 Июня 2011

    Комментарии (25)
  7. JavaScript / Говнокод #6989

    +162

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    <script type="text/javascript">	
    ............................
    var titlePubOk = "<?php echo 'Показано'; ?>";
    var titlePubNo = "<?php echo 'Скрыто'; ?>";
    ............................
    </script>

    Вот обновляю систему и вдруг обнаружил собственный, самый натуральный говнокод. Это - невероятно!

    increazon, 18 Июня 2011

    Комментарии (32)
  8. JavaScript / Говнокод #6961

    +163

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    // Checks if the passed input's value is nothing. 
    function isEmptyText(theField) 
    {     
    // Copy the value so changes can be made..     
    var theValue = theField.value;       
    // Strip whitespace off the left side.     
    while (theValue.length > 0 && (theValue.charAt(0) == ' ' || theValue.charAt(0) == '\t'))
            theValue = theValue.substring(1, theValue.length);
         // Strip whitespace off the right side.
         while (theValue.length > 0 && (theValue.charAt(theValue.length - 1) == ' ' || theValue.charAt(theValue.length - 1) == '\t'))
            theValue = theValue.substring(0, theValue.length - 1);
           if (theValue == '')
            return true;
         else
            return false;
      }
    ...
    function in_array(variable, theArray) 
    {
         for (var i in theArray)
            if (theArray == variable)
               return true;
           return false;
    }

    zomg, 16 Июня 2011

    Комментарии (5)
  9. JavaScript / Говнокод #6942

    +164

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    <script type="text/javascript">
    /* vedomosti mercedes fullscreen second pages */
    var ref=document.referrer;
    var cookie=Get_Cookie('ved_fullscreen2_1');
    if (!cookie && ref!='' && ref!='none' && ref!='blocked' && 'http://'==ref.substring(0,7)) {
    	ref=ref.substring(7);
    	var pos=ref.indexOf('/');
    	var invalid='.vedomosti.ru';
    	if (pos>0) ref=ref.substring(0,pos);
    
    	if (ref.substring( ref.length-invalid.length ) != invalid) {
    		Set_Cookie('ved_cookie_test',1,1);
    		if (Get_Cookie('ved_cookie_test')) {
    			Set_Cookie('ved_fullscreen2_1', 1, 1 * 24 * 3600, '/');
    			document.location.href = 'http://www.vedomosti.ru/var/bansrc/2011/9a6776.html#!'+(document.location.pathname);
    		}
    	}
    }
    </script>

    журнализды из одной пафосной бульварной газетки копят на мерседес

    bugmenot, 13 Июня 2011

    Комментарии (13)
  10. JavaScript / Говнокод #6934

    +164

    1. 1
    2. 2
    // Eolas workaround for IE (Thanks Kurt!)
    		if(jQuery.browser.msie){ this.outerHTML = this.outerHTML; }

    Kurt == К.О.?

    jQuery, 12 Июня 2011

    Комментарии (13)