-
+2
- 001
- 002
- 003
- 004
- 005
- 006
- 007
- 008
- 009
- 010
- 011
- 012
- 013
- 014
- 015
- 016
- 017
- 018
- 019
- 020
- 021
- 022
- 023
- 024
- 025
- 026
- 027
- 028
- 029
- 030
- 031
- 032
- 033
- 034
- 035
- 036
- 037
- 038
- 039
- 040
- 041
- 042
- 043
- 044
- 045
- 046
- 047
- 048
- 049
- 050
- 051
- 052
- 053
- 054
- 055
- 056
- 057
- 058
- 059
- 060
- 061
- 062
- 063
- 064
- 065
- 066
- 067
- 068
- 069
- 070
- 071
- 072
- 073
- 074
- 075
- 076
- 077
- 078
- 079
- 080
- 081
- 082
- 083
- 084
- 085
- 086
- 087
- 088
- 089
- 090
- 091
- 092
- 093
- 094
- 095
- 096
- 097
- 098
- 099
- 100
function plays(){
var snd = new Audio("http://boobooka.com/wp-content/uploads/2013/02/33bells33.mp3");
snd.preload = "auto";
snd.play();
}
function showTime()
{
var dat = new Date();
var ch = dat.getDate();
var montha = new Array();
montha[0] = "января";
montha[1] = "февраля";
montha[2] = "марта";
montha[3] = "апреля";
montha[4] = "мая";
montha[5] = "июня";
montha[6] = "июля";
montha[7] = "августа";
montha[8] = "сентября";
montha[9] = "октября";
montha[10] = "ноября";
montha[11] = "декабря";
var mon = montha[dat.getMonth()];
var ye = dat.getYear()+ 1900;
var ned = dat.getDay();
var day = new Array();
day[1] = "Понедельник";
day[2] = "Вторник";
day[3] = "Среда";
day[4] = "Четверг";
day[5] = "Пятница";
day[6] = "Суббота";
day[0] = "Воскресенье";
var nedel = day[dat.getDay()];
var H = '' + dat.getHours();
H = H.length<2 ? '0' + H:H;
var M = '' + dat.getMinutes();
M = M.length<2 ? '0' + M:M;
var S = '' + dat.getSeconds();
S =S.length<2 ? '0' + S:S;
var clock = H + ':' + M + ':' + S;
var cl = H + M + S;
var chislo = ch+" "+mon;
var chisl = ye+" года";
document.getElementById('time_div').innerHTML=clock;
document.getElementById('ned_div').innerHTML=nedel;
document.getElementById('chi_div').innerHTML=chislo;
document.getElementById('chis_div').innerHTML=chisl;
if(clock == '09:00:00'){if(1<=ned && ned<=6){plays();}}
if(clock == '09:40:00'){if(1<=ned && ned<=6){plays();}}
if(clock == '09:50:00'){if(1<=ned && ned<=6){plays();}}
if(clock == '10:30:00'){if(1<=ned && ned<=6){plays();}}
if(clock == '10:40:00'){if(1<=ned && ned<=6){plays();}}
if(clock == '11:20:00'){if(1<=ned && ned<=6){plays();}}
if(clock == '11:40:00'){if(1<=ned && ned<=6){plays();}}
if(clock == '12:20:00'){if(1<=ned && ned<=6){plays();}}
if(clock == '12:30:00'){if(1<=ned && ned<=6){plays();}}
if(clock == '13:10:00'){if(1<=ned && ned<=6){plays();}}
if(clock == '13:20:00'){if(1<=ned && ned<=6){plays();}}
if(clock == '14:00:00'){if(1<=ned && ned<=6){plays();}}
if(clock == '14:20:00'){if(1<=ned && ned<=6){plays();}}
if(clock == '15:00:00'){if(1<=ned && ned<=6){plays();}}
if(clock == '15:10:00'){if(1<=ned && ned<=6){plays();}}
if(clock == '15:50:00'){if(1<=ned && ned<=6){plays();}}
if(clock == '16:00:00'){if(1<=ned && ned<=6){plays();}}
if(clock == '16:40:00'){if(1<=ned && ned<=6){plays();}}
if(clock == '16:45:00'){if(1<=ned && ned<=6){plays();}}
if(clock == '17:25:00'){if(1<=ned && ned<=6){plays();}}
if(clock == '17:30:00'){if(1<=ned && ned<=6){plays();}}
if(clock == '18:10:00'){if(1<=ned && ned<=6){plays();}}
if(clock == '18:15:00'){if(1<=ned && ned<=6){plays();}}
if(clock == '18:55:00'){if(1<=ned && ned<=6){plays();}}
setTimeout(showTime,1000);
if(1<=ned && ned<=6)
{
if(cl >= 090000 && cl < 094000) {document.getElementById('mes_div').innerHTML="Идет 1-й урок (09:00-09:40)";}
if(cl >= 094000 && cl < 095000) {document.getElementById('mes_div').innerHTML="ПЕРЕМЕНА!!! (09:40-09:50)";}
if(cl >= 095000 && cl < 103000) {document.getElementById('mes_div').innerHTML="Идет 2-й урок (09:50-10:30)";}
if(cl >= 103000 && cl < 104000) {document.getElementById('mes_div').innerHTML="ПЕРЕМЕНА!!! (10:30-10:40)";}
if(cl >= 104000 && cl < 112000) {document.getElementById('mes_div').innerHTML="Идет 3-й урок (10:40-11:20)";}
if(cl >= 112000 && cl < 114000) {document.getElementById('mes_div').innerHTML="ПЕРЕМЕНА!!! (11:20-11:40)";}
if(cl >= 114000 && cl < 122000) {document.getElementById('mes_div').innerHTML="Идет 4-й урок (11:40-12:20)";}
if(cl >= 122000 && cl < 123000) {document.getElementById('mes_div').innerHTML="ПЕРЕМЕНА!!! (12:20-12:30)";}
if(cl >= 123000 && cl < 131000) {document.getElementById('mes_div').innerHTML="Идет 5-й урок (12:30-13:10)";}
if(cl >= 131000 && cl < 132000) {document.getElementById('mes_div').innerHTML="ПЕРЕМЕНА!!! (13:10-13:20)";}
if(cl >= 132000 && cl < 140000) {document.getElementById('mes_div').innerHTML="Идет 6-й урок (13:20-14:00)";}
if(cl >= 140000 && cl < 142000) {document.getElementById('mes_div').innerHTML="ПЕРЕМЕНА!!! (14:00-14:20)";}
if(cl >= 142000 && cl < 150000) {document.getElementById('mes_div').innerHTML="Идет 7-й урок (14:20-15:00)";}
if(cl >= 150000 && cl < 151000) {document.getElementById('mes_div').innerHTML="ПЕРЕМЕНА!!! (15:00-15:10)";}
if(cl >= 151000 && cl < 155000) {document.getElementById('mes_div').innerHTML="Идет 8-й урок (15:10-15:50)";}
if(cl >= 155000 && cl < 160000) {document.getElementById('mes_div').innerHTML="ПЕРЕМЕНА!!! (15:50-16:00)";}
if(cl >= 160000 && cl < 164000) {document.getElementById('mes_div').innerHTML="Идет 9-й урок (16:00-16:40)";}
if(cl >= 164000 && cl < 164500) {document.getElementById('mes_div').innerHTML="ПЕРЕМЕНА!!! (16:40-16:45)";}
if(cl >= 164500 && cl < 172500) {document.getElementById('mes_div').innerHTML="Идет 10-й урок (16:45-17:25)";}
if(cl >= 172500 && cl < 173000) {document.getElementById('mes_div').innerHTML="ПЕРЕМЕНА!!! (17:25-17:30)";}
if(cl >= 173000 && cl < 181000) {document.getElementById('mes_div').innerHTML="Идет 11-й урок (17:30-18:10)";}
if(cl >= 181000 && cl < 181500) {document.getElementById('mes_div').innerHTML="ПЕРЕМЕНА!!! (18:10-18:15)";}
if(cl >= 181500 && cl < 185500) {document.getElementById('mes_div').innerHTML="Идет 12-й урок (18:15-18:55)";}
if(cl >= 185500 && cl < 235959) {document.getElementById('mes_div').innerHTML=" ";}
Исходный код из "научно-практической" работы школьника.
Прихватил с конференции. (Не всё влезло)
RigFox,
27 Апреля 2016
-
+3
- 1
- 2
- 3
setTimeout(function() {
$('#kostyl').click().click();
}, 2000);
Применить сортировку по этому столбцу в таблице после её подгрузки и отработки жс, который строит эту таблицу.
deep,
26 Апреля 2016
-
+1
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
function toggleAdPanelMobile(e) {
if (mobilecheck()) {
if ($(e.target).parents('.catalog-container').length || $(e.target).hasClass('button')) {
if ($('#site-content').hasClass('open')) {
$siteAdv.show();
}
} else {
if (!$('#site-content').hasClass('open')) {
$siteAdv.show();
}
}
}
}
Главное, что работает
inferusvv ,
26 Апреля 2016
-
0
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Task 8_1</title>
<script type="text/javascript">
function charRemover(item) {
var charsMoreThanTwoTimes = "";
var charsMoreThanTwoTimes2 = "";
var tmpString="";
var result = "";
var almostResult = "";
var nextWordBeginning = 0;
for (var a = 0; a < item.length; a++) {
if ((a == nextWordBeginning+1)&&(nextWordBeginning > 0)) {tmpString="";}
if ((a!=item.length-1)&&((item[a]!=' ') && (item[a]!=',') && (item[a]!='.') && (item[a]!=';') && (item[a]!=':') && (item[a]!='!') && (item[a]!='?')))
{
tmpString = tmpString + item[a];
}
else if ((a == item.length -1 ) && ((item[a]!=' ') && (item[a]!=',') && (item[a]!='.') && (item[a]!=';') && (item[a]!=':') && (item[a]!='!') && (item[a]!='?')))
{
tmpString = tmpString + item[a];
for (var j = 0; j < tmpString.length; j++)
{
var counter = 0;
for (var k = 0; k < tmpString.length; k++)
{
if (tmpString[k] == tmpString[j]) {counter++; }
}
if (counter == 1) {almostResult = almostResult + tmpString[j];}
if (counter > 1) { charsMoreThanTwoTimes = charsMoreThanTwoTimes + tmpString[j];}
}
}
else if ((a != item.length-1)&&((item[a]==' ') || (item[a]==',') || (item[a]=='.') || (item[a]==';') || (item[a]==':') || (item[a]=='!'))){
for (var j = 0; j < tmpString.length; j++)
{
var counter = 0;
for (var k = 0; k < tmpString.length; k++)
{
if (tmpString[k] == tmpString[j]) {counter++;}
}
if (counter == 1) {almostResult = almostResult + tmpString[j];}
if (counter > 1) { charsMoreThanTwoTimes = charsMoreThanTwoTimes + tmpString[j];}
}
almostResult = almostResult + item[a];
nextWordBeginning = a;
}
}
counter = 0;
//пройдемся еще раз и удалим символы, которые встречаются более одного раза
for (var i = 0; i < almostResult.length; i++)
{
var shoundCharToBeRemoved = false;
for (var j = 0 ; j < charsMoreThanTwoTimes.length; j++)
{
if (almostResult[i] == charsMoreThanTwoTimes[j]) {shoundCharToBeRemoved = true;}
}
if (shoundCharToBeRemoved == true) {}
else {result = result + almostResult[i];}
}
return result;
}
var sourceString = "У попа была собака";
var destString = charRemover(sourceString);
</script>
</head>
<body>
<script type="text/javascript">
document.write(destString);
</script>
</body>
</html>
Только что начал изучать JavaScript. Знаю, что говнокод, так что не судите строго !
Сама задача: Нanucaть функцuю, нa вxoд кoтoрoй nрuxoдuт cтрoкa, cocтoящaя uз неcкoлькux cлoв. cлoвa
рaзделены nрoбельнымu cuмвoлaмu (nрoбел, тaбуляцuя) u знaкaмu nреnuнaнuя (?!:;,.). Нужнo
вернуть cтрoку, в кoтoрoй будут удaлены вcе cuмвoлы, noвтoряющuеcя xoть в oднoм uз cлoв бoлее
oднoro рaзa.
ololenok,
22 Апреля 2016
-
+7
- 1
- 2
- 3
- 4
function checkPermission(user, post) {
return equals(post.author, user) ||
user.role = 'admin';
}
when you see it, you'll shit bricks
thepotato,
21 Апреля 2016
-
+3
- 1
- 2
- 3
- 4
var pricerawjson = "%7B%22price%22%3A%226973.00%22%2C%22status%22%3A%22active%22%2C%22sell_status%22%3A%22available%22%2C%22old_price%22%3A%227607.0000%22%2C%22price_formatted%22%3A%226%20973%22%2C%22old_price_formatted%22%3A%227%20607%22%7D";
if (pricerawjson.length == 0) {
pricerawjson = '%7B%22price%22%3A%226973%22%2C%22price_formatted%22%3A%226%20973%22%2C%22old_price%22%3A7607%2C%22old_price_formatted%22%3A%227%20607%22%2C%22status%22%3A%22active%22%2C%22sell_status%22%3A%22available%22%7D';
}
kyzi007,
18 Апреля 2016
-
−9
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
function delMessage(id,posted) {
if (confirm("Удалить сообщение от "+posted+" ?")) {
if('corporate'=='common')
{
window.location="/forum/theme/?id=22213&delmsg="+id;
}
else if ('corporate'=='olimpic')
{
window.location="/competitions/kazah/team/?teamId=0&tab=forum&themeId=22213&delmsg="+id;
}
else if ('corporate'=='city')
{
window.location="/city/?id=&tab=forum&themeId=22213&delmsg="+id;
}
else
{
window.location="/corporation/?id=1401150&tab=forum&themeId=22213&delmsg="+id;
}
}
}
function addMessage() {
document.messageForm.submit();
}
function closeMessage() {
var textarea=document.getElementById("messagetext");
if (textarea) textarea.value="";
var div=document.getElementById("submit");
if (div) div.style.display="none";
}
function showSubmit() {
showElement("submit");
}
function messageKeyDown(event) {
if (!event) event=window.event;
if (event.keyCode==13 && event.ctrlKey || event.keyCode==10) {
addMessage();
}
}
d_fomenok,
15 Апреля 2016
-
+4
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
$(document).ready(function() {
setInterval(form_check, 10);
function form_check() {
if ($("#main-order-form input[name='car-name']").attr("value") == "") {
$("#main-order-form button").attr('disabled', 'disabled');
} else {
$("#main-order-form button").removeAttr('disabled');
}
}
});
Валидация формы)))
IKARUS,
08 Апреля 2016
-
+9
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
PlayerContentView.prototype.onEnded = function(force) {
if (force == null) {
force = false;
}
if (force === true) {
force = true;
} else {
force = false;
}
return this.model.playEnded(force);
};
Одно популярное SmartTV приложение
9HwZhWzE0TlZ79FkIeF,
05 Апреля 2016
-
+7
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
function random(min, max){ return Math.floor(Math.random() * (max - min + 1)) + min; }
function go_to(url) { window.open(url); }
function rand_link() {
var a;
a = random(1, 116);
if (a==1) {alert("Найди где в числе Пи находится твой день рождения"); go_to("http://mypiday.com");}
if (a==2) {alert("Кубик рубика онлайн"); go_to("http://iamthecu.be");}
if (a==3) {alert("Симулятор гравитации"); go_to("http://codepen.io/akm2/full/rHIsa");}
if (a==4) {alert("информационно-развлекательное сообщество, весь контент которого создают пользователи. "); go_to("http://pikabu.ru");}
if (a==5) {alert("Управляй червяком"); go_to("http://www.staggeringbeauty.com");}
if (a==7) {alert("Насколько распространена твоя фамилия?"); go_to("http://forebears.io/surnames");}
if (a==8) {alert("интерактивное послание Дай пять! и не только"); go_to("http://sendamessage.to");}
if (a==8) {alert("Уничтожайте будильники различными способами"); go_to("http://www.nomoresnooze.com");}
if (a==10) {alert("Карты google + Lego"); go_to("https://www.buildwithchrome.com");}
if (a==11) {alert("Фотографии разных мест на земле. Надо угадать где это было снято."); go_to("http://www.where-is-this.com");}
if (a==12) {alert("Лайфхаки на все случаи жизни"); go_to("http://www.instructables.com");}
if (a==13) {alert("Cтарые иностранные и советские игры"); go_to("http://pica-pic.com/");}
if (a==14) {alert("наведи курсор на портрет и человек закричит"); go_to("http://loudportraits.com");}
if (a==15) {alert("онлайн-часы"); go_to("http://www.humanclock.com");}
if (a==16) {alert("онлайн календарь"); go_to("http://www.humancalendar.com");}
if (a==17) {alert("сделайте всё хорошо"); go_to("http://button.dekel.ru");}
if (a==18) {alert("2 минуты расслабления"); go_to("http://www.donothingfor2minutes.com/");}
if (a==19) {alert("вы *ниХУЯ не делаете!"); go_to("http://manyahin.ru");}
if (a==20) {alert("гугл наоборот"); go_to("http://elgoog.im");}
if (a==21) {alert("захлопни дверь"); go_to("http://www.biglongnow.com");}
if (a==22) {alert("дайте денег"); go_to("http://www.daitedeneg.ru/");}
if (a==23) {alert("Два.ч - это система форумов, где можно общаться быстро и свободно"); go_to("https://2ch.hk");}
if (a==24) {alert("Зря Яндекс"); go_to("http://zryandex.ru");}
if (a==25) {alert("расщепляй круги до бесконечности"); go_to("http://www.cesmes.fi/pallo.swf");}
if (a==26) {alert("преврати свое имя в лицо"); go_to("http://turnyournameintoaface.com/?name=Саша");}
if (a==27) {alert("калейдоскоп"); go_to("http://inoyan.narod.ru/kaleidoskop.swf");}
if (a==28) {alert("Спроси маму"); go_to("http://sprosimamu.ru");}
if (a==29) {alert("Захватить мир"); go_to("http://thepr.ru");}
if (a==30) {alert("управлять хором"); go_to("http://www.incredibox.com");}
if (a==31) {alert("Лопай пупырки"); go_to("http://mariemarie0000.free.fr/fichiers/images/pop.swf");}
if (a==32) {alert("создай свой мультик"); go_to("https://multator.ru/draw/");}
if (a==33) {alert("смешанные животные"); go_to("http://www.humandescent.com");}
if (a==34) {alert("создай свой красивый неоновый вихрь"); go_to("https://29a.ch/sandbox/2011/neonflames/");}
if (a==35) {alert("почувствуй себя хакером"); go_to("http://hackertyper.com");}
if (a==36) {alert("эволюция глобальной сети"); go_to("http://www.evolutionoftheweb.com");}
if (a==37) {alert("Зависание IE"); go_to("http://mrdoob.com/#/128/internet_explorer_6");}
if (a==38) {alert("Требуй, блять, совет"); go_to("http://fucking-great-advice.ru");}
if (a==39) {alert("Выращиваем зёрнышко"); go_to("http://baboon.co.il/mitoza/");}
if (a==40) {alert("красивая штука, управление стрелками"); go_to("http://hellorun.helloenjoy.com");}
if (a==41) {alert("насилие и девушка в нижнем белье"); go_to("http://xoxma.com.ua/img/flash/00001.swf");}
if (a==42) {alert("можно приближать и отдалять"); go_to("http://zoomquilt2.madmindworx.com/zoomquilt2.swf");}
if (a==43) {alert("Ловите кота"); go_to("http://www.gamedesign.jp/flash/chatnoir/chatnoir.html");}
if (a==44) {alert("Ленивый хакер"); go_to("http://coderpad.ru");}
if (a==45) {alert("Онлайн часы"); go_to("http://time100.ru/fun.html");}
if (a==46) {alert("Синхронные кисти"); go_to("http://weavesilk.com");}
if (a==47) {alert("RGB"); go_to("http://www.rrrgggbbb.com");}
if (a==48) {alert("Мойка для монитора"); go_to("http://www.sanger.dk");}
if (a==49) {alert("Бесконечные танцы"); go_to("http://www.partridgegetslucky.com");}
if (a==50) {alert("Одежда дедушки"); go_to("http://grandpanoclothes.com");}
БД? Не, не слышал...
http://randomfriend.ru/
Goatse,
05 Апреля 2016