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

    +147

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    Если вам нужно запустить скрипт написанный на jQuery по окончанию загрузки страницы
    
    $(document).ready( function(){
      // ну и тут ваш код
    });
    
    Преимущество это метода, в том, что он исполняет скрипт по окончанию загрузки кода страницы, НЕ включая флеш баннеры и видео.

    Увидел на одном сайте, который "учит" jQuery

    substr, 28 Июня 2011

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

    +153

    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
    <form method="POST" id="acceptaction" action="/">
                 <input type="submit" value="Принять участие" name="startUserEvent" />
                 <input type="hidden" value="62" name="userid" />
    </form>
    <div id="result"></div>
    
    jQuery(document).ready(function()
    {
       jQuery("#acceptaction").submit(function(event)) {
        event.preventDefault();
        var form = jQuery( this ),
            term = form.find( 'input[name="userid"]' ).val(),
            url = form.attr( 'action' );
        jQuery.post( url, { userid: term },
          function( data ) {
              var content = jQuery( data ).find( '#content' );
              jQuery( "#result" ).empty().append( content );
          };
        );
       };
    });

    maeln0r, 27 Июня 2011

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

    +158

    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
    $('#home').click(function(){
            $.get("q.php", { id: 1 }, function(data){                            
                $('#content').html(data);
            });
        });
    
        $('#programz').click(function(){
            $.get("q.php", { id: 2 }, function(data){                            
                $('#content').html(data);
            });
        });
    				
        $('#contactz').click(function(){
            $.get("q.php", { id: 3 }, function(data){                            
                $('#content').html(data);
            });
        });
    	
        $('#aboutazz').click(function(){
            $.get("q.php", { id: 4 }, function(data){                            
                $('#content').html(data);
            });
        });
    	
        $('#chatz').click(function(){
            $.get("q.php", { id: 5 }, function(data){                            
                $('#content').html(data);
            });
        });  
    
        $('#advertisement').click(function(){
            $.get("q.php", { id: 6 }, function(data){               
                $('#content').html(data);
            });

    Jquery во всей красе.

    bteam, 27 Июня 2011

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

    +147

    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
    function checkAllRemarks()
    { // ЧТО ЭТО!?!?!?!?17СЕМНАДЦАТЬ!!!!1111
       for (i = 0; i < document.getElementsByTagName("input").length; i++)
       {
            if (document.getElementsByTagName("input")[i].name.split("|").length>=2)
            {
                if (document.getElementsByTagName("input")[i].name.split("|")[0]=="CBR")
                {
                    if (document.getElementsByTagName("input")[i].name.split("|")[1].length==36)
                    {
                        if (document.getElementsByName("allRemarks")[0].checked == true)
                            document.getElementsByTagName("input")[i].checked = true;
                        else
                            document.getElementsByTagName("input")[i].checked = false;            
                    }
                }
            }
        } 
    }

    yasosiska, 27 Июня 2011

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

    +152

    1. 1
    2. 2
    3. 3
    4. 4
    if ('yes'!= 'yes') {
    	checkCaptcha();
    	return true;
    }

    yasosiska, 27 Июня 2011

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

    +147

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    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;
    }

    yasosiska, 27 Июня 2011

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

    +147

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    function nyak_nyak(el) {
        if (confirm("Вы уверены в своих действиях?")) {
            document.location = el.href;
    	}
        return false;
    }

    yasosiska, 27 Июня 2011

    Комментарии (5)
  8. 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)
  9. JavaScript / Говнокод #7070

    +147

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

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

    yasosiska, 27 Июня 2011

    Комментарии (5)
  10. 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)