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

    +155.7

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    function clean(str, pat){
        var m = len(pat);
        var l="", r = "";
        var t = 0;
        while(str.indexOf(pat)!=-1){
            t = str.indexOf(pat);
            l = str.slice(0, t);
            r = str.slice(t+m);
            str = l+r;
        }
        return str;
    }

    la1, 14 Августа 2009

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

    +161.8

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    if( 7 == 26 )
    {
    return confirm("Status 'finished pending' confirmation:\nAre you sure you made all needed operations on this order?");
    }
    else return confirm('Save?');

    Вот такие прелести

    root, 13 Августа 2009

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

    +155.7

    1. 1
    <a href="#" onclick="if ($('#pasteLinkBlock').is(':visible')) $('#pasteLinkBlock').hide('fast'); else $('#pasteLinkBlock').show('fast'); return false">

    Про toggle аффтар никогда не слышал...

    anei, 12 Августа 2009

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

    +144.9

    1. 1
    /a-z{3,}/.test(str);

    Проверка содержит ли функция 3 символа алфавита или больше.
    Правильно так: /[a-z]{3,}/

    Oleg_quadro, 11 Августа 2009

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

    +149

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    function rtrans(ob) {
             eval(ob+".filters.revealTrans.Apply()");
             eval(ob+".style.visibility = 'visible'");
             eval(ob+".filters.revealTrans.Play()");
         }

    Пацталом.

    guest, 31 Июля 2009

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

    +152

    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
    function f0(){
    <?for($i=1;$i<$chp+1;++$i){?>
    tflor=<?=$i?>;
    eval("document.plan"+tflor+".SetVariable('pa1','0')");
    eval("document.plan"+tflor+".SetVariable('pa2','0')");
    eval("document.plan"+tflor+".SetVariable('pa3','0')");
    eval("document.plan"+tflor+".SetVariable('pa4','0')");
    eval("document.plan"+tflor+".SetVariable('pa5','0')");
    eval("document.plan"+tflor+".SetVariable('pa6','0')");
    eval("document.plan"+tflor+".SetVariable('pa7','0')");
    eval("document.plan"+tflor+".SetVariable('pa8','0')");
    eval("document.plan"+tflor+".SetVariable('pa9','0')");
    eval("document.plan"+tflor+".SetVariable('pa10','0')");
    eval("document.plan"+tflor+".SetVariable('pa11','0')");
    eval("document.plan"+tflor+".SetVariable('pa12','0')");
    eval("document.plan"+tflor+".SetVariable('pa13','0')");
    eval("document.plan"+tflor+".SetVariable('pa14','0')");
    eval("document.plan"+tflor+".SetVariable('pa15','0')");
    eval("document.plan"+tflor+".SetVariable('pa16','0')");
    eval("document.plan"+tflor+".SetVariable('pa17','0')");
    <?}?>
    }

    Циклы никто не отменял

    guest, 31 Июля 2009

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

    +166.8

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    if (document.getid.txtemail.value.search("@") == -1)
    {
    	alert("This is not a valid email account.");
    	return(false);
    }
    //check for valid email address required.

    Нашел вот тут в одном индусском проекте, валидакия имейла XD

    guest, 23 Июля 2009

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

    +143.2

    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
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    function setdata()
    {  
    if(document.sunform.town.value == "spb")
       { 
         document.sunform.longitude.value = 30;
         document.sunform.longmin.value = 15;
         document.sunform.latitude.value = 60;
         document.sunform.latmin.value = 00;
         document.sunform.zone.value = +3;
       }
       
       if(document.sunform.town.value == "gbr")
       { 
         document.sunform.longitude.value = 9;
         document.sunform.longmin.value = 56;
         document.sunform.latitude.value = 53;
         document.sunform.latmin.value = 34;
         document.sunform.zone.value = +1;
       }
       
       if(document.sunform.town.value == "msk")
       { 
       ...
       }
       
       if(document.sunform.town.value == "mur")
       { 
       ...
       }
    
       if(document.sunform.town.value == "kiev")
       { 
       ...
       }
    
       if(document.sunform.town.value == "minsk")
       { 
       ...
       }
    
       if(document.sunform.town.value == "soshi")
       { 
       ...
       }
    
       if(document.sunform.town.value == "nn")
       { 
       ...
       }
    
    
       if(document.sunform.town.value == "kazan")
       { 
       ...
       }
    
       if(document.sunform.town.value == "ekb")
       { 
       ...
       }
    
       if(document.sunform.town.value == "novosib")
       { 
       ...
       }
    }

    Кусок скрипта для рассчета времени восхода и захода Солнца.
    Стырено с www.astrotime.ru
    Вместо ... аналогичные присваивания, только с другими числами.

    guest, 16 Июля 2009

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

    +146

    1. 1
    2. 2
    3. 3
    4. 4
    function refreshPage() {
     //alert(document.location);
     document.location = document.location;
    }

    Стырена с моего мира mail.ru

    guest, 16 Июля 2009

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

    +152

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    function allowCheckout(enable) {
        if (enable)
            $("#btnMakeOrder").removeAttr("enabled");
        else
            $("#btnMakeOrder").removeAttr("disabled");
    }

    Код, который написал бельгийский Software Architect, пришедший из мира C++ говонокодинга.
    Дальше будет...

    guest, 14 Июля 2009

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