- 1
- 2
- 3
- 4
- 5
- 6
if(msg == "" || msg == "{}"){
// странный баг, форма очищается, но не прячется
return;
$("#variants_div").html('');
$("variants_div").hide();
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+177
if(msg == "" || msg == "{}"){
// странный баг, форма очищается, но не прячется
return;
$("#variants_div").html('');
$("variants_div").hide();
}
Даже Джумла первая была радостным кодом по сравнению с этим.
+165
function get_sel_values(index){
var test = eval('typeof opt_val'+index);
if ( test != 'undefined' ){
eval('var sel_values = opt_val'+index);
return sel_values;
}
else { return false; }
}
//**************************************************************
function get_sel_text(index){
var test = eval('typeof opt_text'+index);
if ( test != 'undefined' ){
eval('var sel_text = opt_text'+index);
return sel_text;
}
else { return false; }
}
//**************************************************************
function show_select(index, lev, dv){
if ( dv == 'jdc1'){ var tr = "jdc2";}
if ( dv == 'jdc2'){ var tr = "jdc3";}
if ( dv == 'jdc3'){ var tr = "jdc4";}
var curr_sel_text = get_sel_text(index);
var curr_sel_value = get_sel_values(index);
if ( curr_sel_value != false && curr_sel_text != false ){
if ( dv == 'jdc1'){
document.getElementById('jdc1').style.visibility = "visible";
document.getElementById('jdc2').style.visibility = "hidden";
document.getElementById('jdc3').style.visibility = "hidden";
document.getElementById('jdc4').style.visibility = "hidden";
document.forms["form1"].elements['cc2'].length = 0;
document.forms["form1"].elements['cc3'].length = 0;
document.forms["form1"].elements['cc4'].length = 0;
}
if ( dv == 'jdc2'){
document.getElementById('jdc1').style.visibility = "visible";
document.getElementById('jdc2').style.visibility = "visible";
document.getElementById('jdc3').style.visibility = "hidden";
document.getElementById('jdc4').style.visibility = "hidden";
document.forms["form1"].elements['cc3'].length = 0;
document.forms["form1"].elements['cc4'].length = 0;
}
if ( dv == 'jdc3'){
document.getElementById('jdc1').style.visibility = "visible";
document.getElementById('jdc2').style.visibility = "visible";
document.getElementById('jdc3').style.visibility = "visible";
document.getElementById('jdc4').style.visibility = "hidden";
document.forms["form1"].elements['cc4'].length = 0;
}
var count_values = curr_sel_value.length;
var category_list = document.forms["form1"].elements[lev];
var count_category_list = category_list.options.length;
category_list.length = 0;
for (i = 0; i < count_values; i++){
if (document.createElement){
var newCategoryListOption = document.createElement("OPTION");
newCategoryListOption.text = curr_sel_text[i];
newCategoryListOption.value = curr_sel_value[i];
(category_list.options.add) ? category_list.options.add(newCategoryListOption) : category_list.add(newCategoryListOption);
}else{
category_list.options[i] = new Option(curr_sel_text[i], curr_sel_value[i], false, false);
}
}
document.getElementById(tr).style.visibility = "visible";
}
else{
document.getElementById(tr).style.visibility = "hidden";
}
}
//-->
+169
<script type="text/javascript">
opt_text13=new Array("Internet","Hardware","Mobiles","Soft","Sequrity","Networks","Interface");
opt_val13=new Array("14","28","44","54","61","67","72");
opt_val113=new Array("114","115","116","117","118","119","120","121");
opt_text122=new Array("Essays","Scintific Publications","Online Lessons & Tests","Scintific Libraries","Other");
opt_val122=new Array("123","124","125","126","127");
opt_text128=new Array("Your Appartment","Cookery","All for Holidays","Family","Pats","Health","Fashion and Beauty","Purchases");
opt_val128=new Array("129","138","146","155","162","170","179","189");
opt_text129=new Array("Country Cottage","Repair","Construction","Interior Design","Landscape Design","Building Materials","Sanitary","Other");
opt_val129=new Array("130","131","132","133","134","135","136","137");
opt_text138=new Array("Recepies","Diet","Products","Tabacco","Bavarage","Delivery","Other");
opt_val138=new Array("139","140","141","142","143","144","145");
opt_text146=new Array("E-Cards","Tostes and scenaries","Gifts","Flowers Delivery","Holiday Organization","Fireworks","Holidays","Other");
opt_val146=new Array("147","148","149","150","151","152","153","154");
opt_text155=new Array("For Parents","For Children","Relation's Psyhology","Marrage","Marrage Agancies","Other");
//...............
opt_val252=new Array("253","254","255","256","257","258");opt_text259=new Array("Astrology","Fortune-telling","Esotericism","UFO","Other");
opt_val259=new Array("260","261","262","263","264");
opt_text268=new Array("Places","Tourism","Vocation","Hobbies");
opt_val268=new Array("269","280","292","297");
opt_text269=new Array("Restaurants & Bars","Clubs & Diskos","Bowling & Billiard","Casinos","Places for children","Circuses","Parks & Zoos","Theaters","Cinemas","Other");
opt_val269=new Array("270","271","272","273","274","275","276","277","278","279");
opt_text428=new Array("Newspapers","Magazines","Publishing Houses","Business publications","Computer publications","Motor-Car publications","Sport publications","Entertaining publications","Music/Cinema/TV","Publications for women","Publications for men","Publications for kids","Other publications");opt_val428=new Array("429","430","431","432","433","434","435","436","437","438","439","440","441");opt_text446=new Array("Metallurgy","Mechanical engineering","Equipment","Electronics","Energetics","Chemical industry","Agriculture","Food Industry","Factories","Light Industry","Heavy Industry","Other industries");opt_val446=new Array("447","451","458","469","473","479","483","484","485","486","487","488");opt_text447=new Array("Iron industry","Non-ferrous metallurgy","Other");opt_val447=new Array("448","449","450");opt_text451=new Array("Motor-car Factories","Engeenering Factories","Agricultural Factories","Sheepbuilding","Aircraft building","Other");
//........
opt_text529=new Array("Office equipment","Office furneture","Lock boxes","Stationery","Other");opt_val529=new Array("530","531","532","533","534");opt_text536=new Array("Encyclopedias","Transport","Maps","Addresses & Phones","Search people","Dictionaries","Weather","Other");opt_val536=new Array("537","543","552","553","554","555","556","557");opt_text537=new Array("Universal","Medical","Biographical","Subject encyclopedia","Other");opt_val537=new Array("538","539","540","541","542");opt_text543=new Array("Timetables","Air transport","Railway","Sailing","Urban transport","Taxi & Car rent","Bus transport","Other");opt_val543=new Array("544","545","546","547","548","549","550","551");opt_text558=new Array("Other");
opt_val558=new Array("559");//**************************************************************
+168
if(videoID == undefined || typeof videoID == 'undefined' || !videoID){
alert("Invalid video!");
return false;
}
Боги, спасите мою душу от этого проекта
+165
function shake(dom, power, count, duration) {
dom.stop();
for (var i = 0; i < count; i++) {
dom.animate({'margin-left': ((i%2 == 0) ? '+' : '-') + '=' + ((i == 0 || i == count-1) ? power/2 : power)}, duration);
}
}
Оптимизация рулит :)
+158
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
function myTags(mytags){
mytags=mytags.replace(/<A/g, '<a')
.replace(/\/A>/g, "/a>")
.replace(/(\starget=_)(\w*)/g, ' target="_$2"')
.replace(/(\sclass=)(?!")(\w*)/g, ' class="$2"')
.replace(/(\sname=)(?!")(\w*)/g, ' name="$2"')
.replace(/(\sid=)(?!")(\w*)/g, ' id="$2"')
.replace(/(\srel=)(?!")(\w*)/g, ' rel="$2"');
mytags=encodeURIComponent(mytags).replace(/!/g, '%21')
.replace(/'/g, '%27').replace(/\(/g, '%28')
.replace(/\)/g, '%29').replace(/\*/g, '%2A');
var rnumber = Math.floor(Math.random()*9999999);
var flashvars = {
tcolor:"0x2A62C8",
tcolor2:"0x000000",
hicolor:"0xB12AC8",
tspeed:"110",
distr:"true",
mode:"tags",
tagcloud:mytags
};
var params = {
allowScriptAccess:"always",
bgcolor:'#ffffff'
};
var attributes = {
id:"flash_cloud"
};
swfobject.embedSWF("tagcloud.swf?r="+rnumber,
"tags", "600", "420", "9.0.0",
"expressInstall.swf", flashvars,
params, attributes);
}
window.onload=function(){
var mytags="<tags>"
+document.getElementById('tags').innerHTML
+"</tags>";
myTags(mytags);
};
</script>
+157
function auCtrl(whSound,play) {
if (IE) this.src = play? aySound[whSound]:'';
else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
}
+162
window.onload = function() {
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
canvas.height = canvas.height;
canvas.width = canvas.width;
// …
}
+175
$("input[id='yearB']")
+172
var rus_rl = ('А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я-а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я').split('-');