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

    +162

    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
    function poс()
    {
    course = $('#points').text()
    if(course > 10) {
     $.post('/index/',{a:18, s:'LllMmm', subject:'Товар - стикер (чёрная кошка)', message:'Пользователь Гость заказал стикер (чёрная кошка).'});
     } 
     else {_uWnd.alert('Недостаточно баллов.','Ошибка')}
    }
    function pod()
    {
    course = $('#points').text()
    if(course > 15) {
     $.post('/index/',{a:18, s:'LllMmm', subject:'Товар - стикер (миллион долларов)', message:'Пользователь Гость заказал стикер (миллион долларов).'});
     } 
     else {_uWnd.alert('Недостаточно баллов.','Ошибка')}
    }
    function poe()
    {
    course = $('#points').text()
    if(course > 20) {
     $.post('/index/',{a:18, s:'LllMmm', subject:'Товар - стикер (на счастье)', message:'Пользователь Гость заказал стикер (на счастье).'});
     } 
     else {_uWnd.alert('Недостаточно баллов.','Ошибка')}
    }
    function pof()
    {
    course = $('#points').text()
    if(course > 25) {
     $.post('/index/',{a:18, s:'LllMmm', subject:'Товар - стикер (+100)', message:'Пользователь Гость заказал стикер (+100).'});
     } 
     else {_uWnd.alert('Недостаточно баллов.','Ошибка')}
    }
    function pog()
    {
    course = $('#points').text()
    if(course > 15) {
     $.post('/index/',{a:18, s:'LllMmm', subject:'Товар - стикер (настоящий мужчина)', message:'Пользователь Гость заказал стикер (настоящий мужчина).'});
     } 
     else {_uWnd.alert('Недостаточно баллов.','Ошибка')}
    }

    И так 16 функций...

    qePH, 22 Ноября 2010

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

    +160

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    function check() {
      if (document.login.user.value == "user" && document.login.password.value == "correct_password")
        window.location.href = 'http://this.site/login.html';
      else
        window.location.href = 'http://this.site/loginfehler.html';
    return false;
    }

    http://ithappens.ru/bytag/webdev/13 - И смех и грех!

    dwinner, 15 Ноября 2010

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

    +157

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    var Class = function () {
    	this.method = function () {
    		/* … */
    	};
    };
    
    Class = new Class();

    fuckyounoob, 13 Ноября 2010

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

    +145

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    $(function(){
        oCatalog=new Catalog();
      });
          
      Catalog = function (){
        
        function test (data){
          alert(data);
        }
        
      }

    exoundeeq, 12 Ноября 2010

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

    +166

    1. 1
    2. 2
    3. 3
    4. 4
    function goToURL() { //v3.0
      var i, args=goToURL.arguments; document.returnValue = false;
      for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
    }

    ну вы понели

    GoodTalkBot, 11 Ноября 2010

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

    +166

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    function document_write($text)
    {
    	document.write($text);
    	return false;
    }

    говнокод от diary.ru

    desu, 08 Ноября 2010

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

    +165

    1. 1
    alert(( (/([^(A-z)&&(А-я)])/ || prompt.length<1 ).test(prompt('Введите Ваше имя',''))) ? 'Ошибка' : 'Принято')

    Не совсем говнокод, просто весёлый бред. Найдено здесь http://tinyurl.com/22w4b8q

    eval, 05 Ноября 2010

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

    +145

    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
    /*Выпадающее меню - рассчитывание координат и выполнение определенных действий при определенных координатах курсора*/
    
    
    
    //document.onmousemove = function(e){
    
    //    var mCur = mousePageXY(e);
    
    //}
    
    //function mousePageXY(e)
    
    //{
    
    //    var x = 0, y = 0;
    
    //
    
    //    if (!e) e = window.event;
    
    //
    
    //    if (e.pageX || e.pageY)
    
    //    {
    
    //        x = e.pageX;
    
    //        y = e.pageY;
    
    //    }
    
    //
    
    //    else if (e.clientX || e.clientY)
    
    //    {
    
    //        x = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft;
    
    //        y = e.clientY + (document.documentElement.scrollTop || document.body.scrollTop) - document.documentElement.clientTop;
    
    //    }
    
    //    if ((((screen.width/2-491)>x)||(screen.width/2+409<x))||((screen.width/2-491<x)&&(y<125)&&((screen.width/2-274)>x))||(y>170+height)||(((screen.width/2-274)<x)&&(y<173)))  {
    
    //        document.getElementById("menu").style.display = 'none'
    
    //    }
    
    //    return {
    
    //        "x":x,
    
    //        "y":y
    
    //    };
    
    //}

    minnigaliev-r, 04 Ноября 2010

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

    +161

    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
    /* Fade-In Page script ©2008 John Davenport Scheuer
       As first seen in http://www.dynamicdrive.com/forums/
       username:jscheuer1 - This credit must remain for legal use.
       */
     
    fadeInPage.speed=15; //Set speed of transition for non-IE, lower numbers are faster, 20 is the minimum safe value
    fadeInPage.bg='#000'; //Set backgroud style (color or color and image) of transition division for non-IE, should match page background or the predominant color of the page
     
    ///////////////// Stop Editing /////////////////
     
    function fadeInPage(){
    var el=document.getElementById("fadeDiv");
    el.style[fadeInPage.prprt] = el.style[fadeInPage.prprt] == ''? 1 : el.style[fadeInPage.prprt];
    if (el.style[fadeInPage.prprt] > 0){
    el.style[fadeInPage.prprt] = el.style[fadeInPage.prprt] - 0.02;
    setTimeout("fadeInPage()", fadeInPage.speed);
    }
    else {
    el.style[fadeInPage.prprt] = 0;
    if(document.removeChild)
    el.parentNode.removeChild(el);
    }
    }
    if(document.documentElement&&document.documentElement.style){
    fadeInPage.d=document.documentElement, fadeInPage.t=function(o){return typeof fadeInPage.d.style[o]=='string'};
    fadeInPage.prprt=fadeInPage.t('opacity')? 'opacity' : fadeInPage.t('MozOpacity')? 'MozOpacity' : fadeInPage.t('KhtmlOpacity')? 'KhtmlOpacity' : null;
    }
    fadeInPage.set=function(){
    var prop=fadeInPage.prprt=='opacity'? 'opacity' : fadeInPage.prprt=='MozOpacity'? '-moz-opacity' : '-khtml-opacity';
    document.write('\n<style type="text/css">\n#fadeDiv {\nheight:'+window.innerHeight+'px;display:block;position:fixed;'+
    'z-index:10000;top:0;left:0;background:'+fadeInPage.bg+';width:100%;\n'+ prop +':1;\n}\n<\/style>\n');
    }
    if(window.addEventListener&&fadeInPage.prprt){
    fadeInPage.set();
    window.addEventListener('load', fadeInPage, false);
    }

    Зашел я на сайт родного биллинга. Не работает. Смотрю - остался слой от fade-in (нахрена он в биллинге).
    Открыл исходники сайта и увидел там ЭТО.
    Отступы авторские. Очень радует "document.write('\n<style" в цикле.

    m1el, 29 Октября 2010

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

    +122

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    Код из нового  курса  Е.Попова по JS и JQuery
    
    var name = "Иваh";
    for (var i = 0; i < name.length; i++) {
        if (name.charCodeAr(i) < 1040 || name.charCodeAt(i) > 1103 {
            document.write("Найден символ: " + name.charAt(i));
        }
    }

    Vasiliy, 28 Октября 2010

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