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

    +165

    1. 1
    2. 2
    3. 3
    4. 4
    var shops=new Array();
    shops[shops.length] = new Array('',' ');
    shops[shops.length] = new Array(' The Jewel Box', '135956406_923');
    shops[shops.length] = new Array(' Склад 1', '135956406_923');

    И таких вызовов порядка 2к

    via http://pickpoint.ru/monitoring/

    kopoBko, 24 Сентября 2014

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

    +160

    1. 1
    2. 2
    3. 3
    this.isWait && result.push(campLinkCid);
    
    result.push(this.isWait ? camp.bid : campLinkCid);

    Нужно больше логики.

    kainwinterheart, 23 Сентября 2014

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

    +156

    1. 1
    jQuery("#myId"+object+".myTr"+array.length-1).append(JSON.parse(object));

    Appending result to grid table

    armengabriel, 22 Сентября 2014

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

    +127

    1. 1
    ['10','10','10','10'].map(parseInt)

    Результат:

    [10, NaN, 2, 3]

    someone, 22 Сентября 2014

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

    +143

    1. 1
    2. 2
    3. 3
    if (typeof window.$lab === 'undefined') {
        document.write('<script type="text/javascript">var $lab = jQuery.noConflict(true);\x3C/script>');
    }

    потому что eval - зло
    P.s. \x3C/script> - такая запись ибо впилено тегом скрипт в head

    RedMonkey, 18 Сентября 2014

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

    +135

    1. 1
    function e(id){ return document.getElementById(id); }

    Бредогенерации тред.

    3.14159265, 17 Сентября 2014

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

    +155

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    ...
    $ (object.position).animate (data.point, { duration: data.instant ? 1 : 7 * distance,
        progress: data.instant ? function () {} : function (lol, progress) {
            object.position.y = data.point.y + Math.abs (Math.sin (progress * distance * 0.3));
        },
        always: data.instant ? function () {} : function () {
            object.position.y = data.point.y;
            ...

    как труъ, сделать if (data.instant) { ... } или и так покатит?

    makc3d, 16 Сентября 2014

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

    +151

    1. 1
    2. 2
    3. 3
    4. 4
    //...
    <script>splashRadar('leftcol', 1);</script>
    <script>splashRadar('baseStyles');</script>
    //...

    На мейл.сру.

    gost, 14 Сентября 2014

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

    +157

    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
    $('#id_accept_eula').click(function () {
        // код аффтара
        try {
            var v = 1 - this.getAttribute('value');
            this.setAttribute('value', v);
            if (v == 1) {
                $('#submit_button').removeAttr('disabled');
            } else {
                $('#submit_button').attr('disabled', 'disabled');
            }
        } catch (e) {
            alert('exc: ' + e);
        }
        // заменил на
        $("#submit_button").prop('disabled', !this.checked);
    });

    Когда платят за строки кода...

    govnozmey, 14 Сентября 2014

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

    +153

    1. 1
    2. 2
    $("div.entry-comment-wrapper").has("p strong a").each( function (i,e){
    $.ajax({'url':'http://govnokod.ru/ratings/comment/'+$(e).attr('id').replace('comment-','')+'/against'}) } );

    gost, 12 Сентября 2014

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