ЙажаСценарий / Говнокод #2863 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
function blinkschu() {
  if (document.getElementById("blinki").style.visibility=="hidden") document.getElementById("blinki").style.visibility="visible";
  else document.getElementById("blinki").style.visibility="hidden";
}
window.setInterval("blinkschu()",300);

как же меня бесит мигание... А вас?

vov4ik vov4ik, (Updated )

Комментарии (10, +10)

ЙажаСценарий / Говнокод #2850 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
for (var i = 1; i <= 4; i++) {
            var el = O.get('#upcoming' + i);
            if (el == undefined) {
                continue;
            }
            O.countdown('#upcoming' + i, '<b>%D% %DT% %H% %HT% %M% %MT% %S% %ST%</b>', {
                leadingZeroes: false,
                overrideSeconds: O.get('#upcoming' + i + ' input').value
            });
        }

отличный каунт даун от Opera
http://my.opera.com/community/countup/

дергаем данные с сервера до посинения
фаерфокс умер через 5 минут)

nur nur, (Updated )

Комментарии (3, +3)

ЙажаСценарий / Говнокод #2843 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  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
function str_replace ( search, replace, subject ) {	// Replace all occurrences of the search string with the replacement string
	// 
	// +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
	// +   improved by: Gabriel Paderni

	if(!(replace instanceof Array)){
		replace=new Array(replace);
		if(search instanceof Array){//If search	is an array and replace	is a string, then this replacement string is used for every value of search
			while(search.length>replace.length){
				replace[replace.length]=replace[0];
			}
		}
	}

	if(!(search instanceof Array))search=new Array(search);
	while(search.length>replace.length){//If replace	has fewer values than search , then an empty string is used for the rest of replacement values
		replace[replace.length]='';
	}

	if(subject instanceof Array){//If subject is an array, then the search and replace is performed with every entry of subject , and the return value is an array as well.
		for(k in subject){
			subject[k]=str_replace(search,replace,subject[k]);
		}
		return subject;
	}

	for(var k=0; k<search.length; k++){
		var i = subject.indexOf(search[k]);
		while(i>-1){
			subject = subject.replace(search[k], replace[k]);
			i = subject.indexOf(search[k],i);
		}
	}

	return subject;

}

function str_replace(search, replace, subject) { return subject.split(search).join(replace);}

DrFreez DrFreez, (Updated )

Комментарии (7, +7)

ЙажаСценарий / Говнокод #2824 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
<div id="watch-player-div" class="flash-player">
<div id="watch-noplayer-div">
<noscript>У вас отключен JavaScript либо установлена устаревшая версия проигрывателя Adobe Flash. <a href="http://www.adobe.com/go/getflashplayer/" onmousedown="yt.analytics.urchinTracker('/Events/VideoWatch/GetFlash');">Загрузите новый проигрыватель Flash</a>.</noscript>
<script type="text/javascript">
document.write('У вас отключен JavaScript либо установлена устаревшая версия проигрывателя Adobe Flash. <a href=\"http:\/\/www.adobe.com\/go\/getflashplayer\/\" onmousedown=\"yt.analytics.urchinTracker(\'\/Events\/VideoWatch\/GetFlash\');\">Загрузите новый проигрыватель Flash<\/a>.');
</script>
</div>

Найдено на youtube.com , в хтмл коде страницы любого видео (http://www.youtube.com/watch?v=НаборБуквИЦифр)

usver usver, (Updated )

Комментарии (12, +12)

ЙажаСценарий / Говнокод #2796 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
function isValidEmail(address) {
    if (address.indexOf('@') < 1) return false;
    var name = address.substring(0, address.indexOf('@'));
    var domain = address.substring(address.indexOf('@') + 1);
    if (name.indexOf('(') != -1 || name.indexOf(')') != -1 || name.indexOf('<') != -1 || name.indexOf('>') != -1 || name.indexOf(',') != -1 || name.indexOf(';') != -1 || name.indexOf(':') != -1 || name.indexOf('\\') != -1 || name.indexOf('"') != -1 || name.indexOf('[') != -1 || name.indexOf(']') != -1 || name.indexOf(' ') != -1) return false;
    if (domain.indexOf('(') != -1 || domain.indexOf(')') != -1 || domain.indexOf('<') != -1 || domain.indexOf('>') != -1 || domain.indexOf(',') != -1 || domain.indexOf(';') != -1 || domain.indexOf(':') != -1 || domain.indexOf('\\') != -1 || domain.indexOf('"') != -1 || domain.indexOf('[') != -1 || domain.indexOf(']') != -1 || domain.indexOf(' ') != -1) return false;
    return true;
}

проверка email на валидность по индусски

avm avm, (Updated )

Комментарии (17, +17)

ЙажаСценарий / Говнокод #2765 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  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
  67. 67
Char2Hex = new Object();

Char2Hex['_']='%5F';
Char2Hex['А']='%C0';
Char2Hex['Б']='%C1';
Char2Hex['В']='%C2';
Char2Hex['Г']='%C3';
Char2Hex['Д']='%C4';
Char2Hex['Е']='%C5';
Char2Hex['Ж']='%C6';
Char2Hex['З']='%C7';
Char2Hex['И']='%C8';
Char2Hex['Й']='%C9';
Char2Hex['К']='%CA';
Char2Hex['Л']='%CB';
Char2Hex['М']='%CC';
Char2Hex['Н']='%CD';
Char2Hex['О']='%CE';
Char2Hex['П']='%CF';
Char2Hex['Р']='%D0';
Char2Hex['С']='%D1';
Char2Hex['Т']='%D2';
Char2Hex['У']='%D3';
Char2Hex['Ф']='%D4';
Char2Hex['Х']='%D5';
Char2Hex['Ц']='%D6';
Char2Hex['Ч']='%D7';
Char2Hex['Ш']='%D8';
Char2Hex['Щ']='%D9';
Char2Hex['Ъ']='%DA';
Char2Hex['Ы']='%DB';
Char2Hex['Ь']='%DC';
Char2Hex['Э']='%DD';
Char2Hex['Ю']='%DE';
Char2Hex['Я']='%DF';
Char2Hex['а']='%E0';
Char2Hex['б']='%E1';
Char2Hex['в']='%E2';
Char2Hex['г']='%E3';
Char2Hex['д']='%E4';
Char2Hex['е']='%E5';
Char2Hex['ж']='%E6';
Char2Hex['з']='%E7';
Char2Hex['и']='%E8';
Char2Hex['й']='%E9';
Char2Hex['к']='%EA';
Char2Hex['л']='%EB';
Char2Hex['м']='%EC';
Char2Hex['н']='%ED';
Char2Hex['о']='%EE';
Char2Hex['п']='%EF';
Char2Hex['р']='%F0';
Char2Hex['с']='%F1';
Char2Hex['т']='%F2';
Char2Hex['у']='%F3';
Char2Hex['ф']='%F4';
Char2Hex['х']='%F5';
Char2Hex['ц']='%F6';
Char2Hex['ч']='%F7';
Char2Hex['ш']='%F8';
Char2Hex['щ']='%F9';
Char2Hex['ъ']='%FA';
Char2Hex['ы']='%FB';
Char2Hex['ь']='%FC';
Char2Hex['э']='%FD';
Char2Hex['ю']='%FE';
Char2Hex['я']='%FF';

счастливые ользователи mail.ru могут наблюдать этот код в странице чтения входящего сообщения

danilissimus danilissimus, (Updated )

Комментарии (30, +30)

ЙажаСценарий / Говнокод #2735 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
var obj=document.all.cont_small;
obj.focus();
    if      (window.getSelection)   selected = window.getSelection().toString();      
    else if (document.getSelection) selected = document.getSelection();                
    else if (document.selection)   selected = document.selection.createRange();  
    selected.value = "[img]"+SmileId+"[/img]";

Santrex Santrex, (Updated )

Комментарии (4, +4)

ЙажаСценарий / Говнокод #2733 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
Element = function (AttributeName, AttributeValue) {
	arr = [];
	if (document.getElementsByTagName("*")[0] && document.getElementsByTagName("*")[0].getAttribute(AttributeName) == AttributeValue) arr.push(document.getElementsByTagName("*")[0]);
	if (document.getElementsByTagName("*")[1] && document.getElementsByTagName("*")[1].getAttribute(AttributeName) == AttributeValue) arr.push(document.getElementsByTagName("*")[1]);
	if (document.getElementsByTagName("*")[2] && document.getElementsByTagName("*")[2].getAttribute(AttributeName) == AttributeValue) arr.push(document.getElementsByTagName("*")[2]);
	if (document.getElementsByTagName("*")[3] && document.getElementsByTagName("*")[3].getAttribute(AttributeName) == AttributeValue) arr.push(document.getElementsByTagName("*")[3]);

...

if (document.getElementsByTagName("*")[997] && document.getElementsByTagName("*")[997].getAttribute(AttributeName) == AttributeValue) arr.push(document.getElementsByTagName("*")[997]);
	if (document.getElementsByTagName("*")[998] && document.getElementsByTagName("*")[998].getAttribute(AttributeName) == AttributeValue) arr.push(document.getElementsByTagName("*")[998]);
	if (document.getElementsByTagName("*")[999] && document.getElementsByTagName("*")[999].getAttribute(AttributeName) == AttributeValue) arr.push(document.getElementsByTagName("*")[999]);
	return arr
}

eval eval, (Updated )

Комментарии (12, +12)