- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
var _U = "undefined";
if (blabla == _U)
var obj = {
'init': function (){o=this;o.param=true},
'somefunction': function (){return o.param;}
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+147
var _U = "undefined";
if (blabla == _U)
var obj = {
'init': function (){o=this;o.param=true},
'somefunction': function (){return o.param;}
}
Пара примеров обфускации.
+143.1
function ExportExcel(boolean forceComplete)
{
if (forceComplete){
var oXML = document.createElement('XML');
if (document.getElementById('ExportExcel') != null)
document.body.removeChild(document.getElementById('ExportExcel'));
var URL = 'ExportExcelHandler.ashx?taskID=' + document.getElementById("hTaskId").value +
'&guids=' + document.getElementById("hSelIds").value
oXML.src = URL;
document.body.appendChild(oXML);
oXML.ondatasetcomplete = showExcelFile;
} else {
setTimeout("ExportExcel(true);", 100);
}
}
суровый аякс :) ждем 100 миллисекунд и считаем, что документ загрузился)
+132.2
(function($) {
$(document).ready(function(){
//Love jQuery :)
$("#noscript_testimonials").parent().append($('#noscript_testimonials > *').clone().css({"overflow": "hidden", "position": "relative", "width": "250px", "margin-left": "15px"}).find(".noscript_testimonials").each(function (){ $(this).remove(); }).end()).find("#noscript_testimonials").remove().end().find('#testimonials').cycle({
fx: 'scrollDown',
cleartype: true,
pause: true
});
});
})(jQuery);
И обфускация не нужна)
+138
alert('Anticat!!!!!1 ;)');
AlexTheC0d3r
+213.2
function validateForm(form) {
if (isNotEmpty(form.name1)) {
if (isNotEmpty(form.name2)) {
if (isNotEmpty(form.eMail)) {
if (isEMailAddr(form.eMail)) {
if (isChosen(form.continent)) {
if (isValidRadio(form.accept)) {
return true;
}
}
}
}
}
}
return false;
}
решение "в лоб".
+157.9
var ext = /(\.[^.]*?)$/.exec(filename)?/(\.[^.]*?)$/.exec(filename)[1]:/[\/\\]([^\/\\]*?)$/.exec(filename)?/[\/\\]([^\/\\]*?)$/.exec(filename)[1]:filename; // I love JavaScript :)
получаем расширение файла )
+158.9
if(this.o)
{
if((cur=='1')||(cur=='2'))cur='2';
if((cur=='3')||(cur=='4'))cur='4';
if((cur=='5')||(cur=='6'))cur='6';
if((cur=='7')||(cur=='8'))cur='8';
};
/*
Ну а чувакам пИсавшим эту функциию, посвящается:
*/
if(cur & 1)
++cur;
Фрагмент кода из CMS Bitrix 7
+166.1
<script language='JavaScript' type='text/javascript'>
document.write( '<span style=\'display: none;\'>' );
</script>
Этот e-mail адрес защищен от спам-ботов, для его просмотра у Вас должен быть включен Javascript
<script language='JavaScript' type='text/javascript'>
document.write( '</' );
document.write( 'span>' );
</script>
+141.7
function GetRandomChance(startchance,endchance)
{
var randomvalue = new Array;
randomvalue[0]=(Math.random()*(startchance/endchance));
randomvalue[1]=(Math.random()*(endchance/startchance));
randomvalue[2]=(Math.random()*(48375427/54277435));
randomvalue[3]=(randomvalue[0]/randomvalue[1]);
randomvalue[4]=(randomvalue[3]/randomvalue[2]);
randomvalue[5]=(randomvalue[4]*(startchance/endchance));
randomvalue[6]=(randomvalue[5]*Math.random()*182473646646*134636463*randomvalue[0]*randomvalue[3]*randomvalue[5]);
return(randomvalue[6]);
}
function GetSSIODC(siteSpoiler)
{
BaseCutR=siteSpoiler.indexOf("["+defCut+"=");
StartCutR=(BaseCutR+("["+defCut+"=").length);
PreCutR=(siteSpoiler.slice(StartCutR).indexOf("]"));
EndCutR=(StartCutR+PreCutR);
CheckCutR=(EndCutR+siteSpoiler.slice(StartCutR).indexOf('['+defCut));
if(CheckCutR==EndCutR-1||EndCutR<CheckCutR){BoolCutR=true;}
if(BoolCutR==true){StringCutR=siteSpoiler.slice(StartCutR,EndCutR);}
}
function GetSSIODCNG(siteSpoiler)
{
BaseCut2R=siteSpoiler.indexOf("["+defCutNG+"=");
StartCut2R=(BaseCut2R+("["+defCutNG+"=").length);
PreCut2R=(siteSpoiler.slice(StartCut2R).indexOf("]"));
EndCut2R=(StartCut2R+PreCut2R);
CheckCut2R=(EndCut2R+siteSpoiler.slice(StartCut2R).indexOf('['+defCutNG));
if(CheckCut2R==EndCut2R-1||EndCut2R<CheckCut2R)
{
BoolCut2R=true;
}
if(BoolCut2R==true)
{
StringCut2R=siteSpoiler.slice(StartCut2R, EndCut2R);
}
}
function RetAHSFGSHS(siteSpoiler)
{
Random[1]=GetRandomChance(1000000000,100000);
Random[2]=GetRandomChance(1000000,100);
siteSpoiler=siteSpoiler.replace('['+defCutNG+']',f_defPreSPMsgTitle1a(""+Random[1]+i)+Random[1]+i+f_defPreSPMsgTitle1b+(x_imageSpoilerIcon_cl&&x_imageSpoilerIcon_op?(f_defPreSPMsgSPICON_x_imageSp()+Random[1]+i+f_defPostSPMsgSPICON_x_imageSp):"")+DefaultSpoilerText+f_defPostSPMsgTitle1a+Random[1]+i+f_defPostSPMsgTitle1b).replace('['+defCutNG+'=',f_defPreSPMsgTitle1a(""+Random[2]+i)+Random[2]+i+f_defPreSPMsgTitle1b+(x_imageSpoilerIcon_cl&&x_imageSpoilerIcon_op?(f_defPreSPMsgSPICON_x_imageSp()+Random[2]+i+f_defPostSPMsgSPICON_x_imageSp):"")+StringCut2R+f_defPostSPMsgTitle1a+Random[2]+i+f_defPostSPMsgTitle1b).replace((StringCut2R+']'),'');
return(siteSpoiler);
}
function RetAHSFGNOSHS(siteSpoiler)
{
siteSpoiler=siteSpoiler.replace('['+defCutNG+']',defPreHTWSPMsgTitle+DefaultHiddenTextWarning+defPostHTWSPMsgTitle).replace('['+defCutNG+'=',defPreHTW2SPMsgTitle+StringCut2R+defPostHTW2SPMsgTitle+DefaultHiddenTextWarning+defPost2HTW2SPMsgTitle).replace((StringCut2R+']'),'');
return(siteSpoiler);
}
function RetSTDAHSFG(siteSpoiler)
{
Random[3]=GetRandomChance(1000000000,100000);
Random[4]=GetRandomChance(1000000,100);
siteSpoiler=siteSpoiler.replace('['+defCut+']',f_defPreSPMsgTitle1a(""+Random[3]+i)+Random[3]+i+f_defPreSPMsgTitle1b+(x_imageSpoilerIcon_cl&&x_imageSpoilerIcon_op?(f_defPreSPMsgSPICON_x_imageSp()+Random[3]+i+f_defPostSPMsgSPICON_x_imageSp):"")+DefaultSpoilerText+f_defPostSPMsgTitle1a+Random[3]+i+f_defPostSPMsgTitle1b).replace('['+defCut+'=',f_defPreSPMsgTitle1a(""+Random[4]+i)+Random[4]+i+f_defPreSPMsgTitle1b+(x_imageSpoilerIcon_cl&&x_imageSpoilerIcon_op?(f_defPreSPMsgSPICON_x_imageSp()+Random[4]+i+f_defPostSPMsgSPICON_x_imageSp):"")+StringCutR+f_defPostSPMsgTitle1a+Random[4]+i+f_defPostSPMsgTitle1b).replace((StringCutR+']'), '');
return(siteSpoiler);
}
function RetNOAHSFGSHS(siteSpoiler)
{
Random[5]=GetRandomChance(1000000000,100000);
Random[6]=GetRandomChance(1000000,100);
Random[7]=GetRandomChance(1000000000000,100000);
Random[8]=GetRandomChance(1000000,100000);
siteSpoiler=siteSpoiler.replace('['+defCutNG+']',f_defPreSPMsgTitle1a(""+Random[5]+i)+Random[5]+i+f_defPreSPMsgTitle1b+(x_imageSpoilerIcon_cl&&x_imageSpoilerIcon_op?(f_defPreSPMsgSPICON_x_imageSp()+Random[5]+i+f_defPostSPMsgSPICON_x_imageSp):"")+DefaultSpoilerText+f_defPostSPMsgTitle1a+Random[5]+i+f_defPostSPMsgTitle1b).replace('['+defCutNG+'=',f_defPreSPMsgTitle1a(""+Random[6]+i)+Random[6]+i+f_defPreSPMsgTitle1b+(x_imageSpoilerIcon_cl&&x_imageSpoilerIcon_op?(f_defPreSPMsgSPICON_x_imageSp()+Random[6]+i+f_defPostSPMsgSPICON_x_imageSp):"")+StringCut2R+f_defPostSPMsgTitle1a+Random[6]+i+f_defPostSPMsgTitle1b).replace((StringCut2R+']'),'');
siteSpoiler=siteSpoiler.replace('['+defCut+']',f_defPreSPMsgTitle1a(""+Random[7]+i)+Random[7]+i+f_defPreSPMsgTitle1b+(x_imageSpoilerIcon_cl&&x_imageSpoilerIcon_op?(f_defPreSPMsgSPICON_x_imageSp()+Random[7]+i+f_defPostSPMsgSPICON_x_imageSp):"")+DefaultSpoilerText+f_defPostSPMsgTitle1a+Random[7]+i+f_defPostSPMsgTitle1b).replace('['+defCut+'=',f_defPreSPMsgTitle1a(""+Random[8]+i)+Random[8]+i+ f_defPreSPMsgTitle1b+(x_imageSpoilerIcon_cl&&x_imageSpoilerIcon_op?(f_defPreSPMsgSPICON_x_imageSp()+Random[8]+i+f_defPostSPMsgSPICON_x_imageSp):"")+StringCutR+f_defPostSPMsgTitle1a+Random[8]+i+f_defPostSPMsgTitle1b).replace((StringCutR+']'),'');
return(siteSpoiler);
}
function RetNOAHSFGNOSHS(siteSpoiler)
{
siteSpoiler=siteSpoiler.replace('['+defCutNG+']',defPreHTWSPMsgTitle+DefaultHiddenTextWarning+defPostHTWSPMsgTitle).replace('['+defCutNG +'=',defPreHTW2SPMsgTitle+StringCut2R+defPostHTW2SPMsgTitle+DefaultHiddenTextWarning+defPost2HTW2SPMsgTitle).replace((StringCut2R+']'),'');
siteSpoiler=siteSpoiler.replace('['+defCut+']',defPreHTWSPMsgTitle+DefaultHiddenTextWarning+defPostHTWSPMsgTitle).replace('['+defCut+'=',defPreHTW2SPMsgTitle+StringCutR+defPostHTW2SPMsgTitle+DefaultHiddenTextWarning+defPost2HTW2SPMsgTitle).replace((StringCutR+']'),'');
return(siteSpoiler);
}
+148
<script type="text/javascript">
$(document).ready(function(){
$(".in").hover(
function () {
$(this).css("background-color","#EEE7C5");
},
function () {
$(this).css("background-color","#97CAFF");
}
)
});
</script>
<div onclick="location.href='feed2.png';" style="cursor: pointer;" class="in">
Блог
</div>