- 1
- 2
- 3
- 4
- 5
$('div').each(function () {
if ($(this).attr('id') == 'blok') {
$(this).html('');
}
});
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+207.3
$('div').each(function () {
if ($(this).attr('id') == 'blok') {
$(this).html('');
}
});
Хочется взять и уебать…
+145.6
extend(Object, {
extend: extend,
inspect: inspect,
toJSON: toJSON,
toQueryString: toQueryString,
toHTML: toHTML,
keys: keys,
values: values,
clone: clone,
isElement: isElement,
isArray: isArray,
isHash: isHash,
isFunction: isFunction,
isString: isString,
isNumber: isNumber,
isUndefined: isUndefined
});
Из Prototype JS.
+167.6
--------------хтмл заголовок, ява скрипты -------------------
function CheckFields(){
if(document.feedback.password.value!='0A23BD671'){
alert('Пароль неправильный!');
document.feedback.password.focus();
document.feedback.password.select();
return false;
}
}
------------------хтмл-------------------------------------------------
<form name="feedback" action="/handlers/get_prz.php" method=POST onSubmit="return CheckFields()">
<tr bgcolor="#dfefef" >
<td align="right"><b>Пароль: </b></td>
<td valign="top"><INPUT TYPE="PASSWORD" NAME="password" SIZE="9" value=""></b>
<INPUT TYPE="HIDDEN" NAME="ftpzip" SIZE="9" value="finans.zip"></b></td>
</tr>
<tr bgcolor="#dfefef" >
<td colspan=2 align="center">
<INPUT TYPE="submit" VALUE="Скачать 2.8Mb" style="color:#cc0000;font-weight:bold;background=#dfefef">
</td></tr></form>
иф пассворд не равен пассворд..... а с какого сайта я скопикомуниздил этот код, типа ERP система Компас... серьезная софтина для крупных предпрятий... а на сайте такое твориться... как теперь можно доверить такой софтине, сайт для которой студенты писали... ды, нет, думаю студенты не такие дубы чтоб такое писать, школьники наверное....
оригинал кода например тут - http://www.compas.ru/solutions/prz_fin.php
там почти все файлы типа через пароль качать...
+160.4
$('input').each(function () {
if ($(this).attr('type') == 'text') {
this.className = 'textInput';
}
if ($(this).attr('type') == 'password') {
this.className = 'passwordInput';
}
});
$('textarea').each(function () {
this.className = 'textarea';
});
это чудо было найдено здесь http://uweb.ws/publ/javascript/dobavljaem_vsem_ehlementam_input_i_texta rea_klassy/1-1-0-8
+149.1
myAutoComp.formatResult = function(oResultData, sQuery, sResultMatch) {
.....
var aMarkup = ["<div class='myCustomResult'>",
"<span style='font-weight:bold'>",
sKey,
"</span>",
sKeyRemainder,
": ",
moreData1,
", ",
moreData2,
"</div>"];
return (aMarkup.join(""));
};
Отсюда http://developer.yahoo.com/yui/examples/autocomplete/ac_basic_xhr.html
+174.4
document.body.innerHTML = document.body.innerHTML.replace("[b]", "<b>");
document.body.innerHTML = document.body.innerHTML.replace("[/b]", "</b>");
document.body.innerHTML = document.body.innerHTML.replace("[b]", "<b>");
document.body.innerHTML = document.body.innerHTML.replace("[/b]", "</b>");
document.body.innerHTML = document.body.innerHTML.replace("[b]", "<b>");
document.body.innerHTML = document.body.innerHTML.replace("[/b]", "</b>");
document.body.innerHTML = document.body.innerHTML.replace("[b]", "<b>");
document.body.innerHTML = document.body.innerHTML.replace("[/b]", "</b>");
document.body.innerHTML = document.body.innerHTML.replace("[b]", "<b>");
document.body.innerHTML = document.body.innerHTML.replace("[/b]", "</b>");
document.body.innerHTML = document.body.innerHTML.replace("[b]", "<b>");
document.body.innerHTML = document.body.innerHTML.replace("[/b]", "</b>");
document.body.innerHTML = document.body.innerHTML.replace("[b]", "<b>");
document.body.innerHTML = document.body.innerHTML.replace("[/b]", "</b>");
document.body.innerHTML = document.body.innerHTML.replace("[b]", "<b>");
document.body.innerHTML = document.body.innerHTML.replace("[/b]", "</b>");
document.body.innerHTML = document.body.innerHTML.replace("[b]", "<b>");
document.body.innerHTML = document.body.innerHTML.replace("[/b]", "</b>");
document.body.innerHTML = document.body.innerHTML.replace("[b]", "<b>");
document.body.innerHTML = document.body.innerHTML.replace("[/b]", "</b>");
bb-коды на индусском сайте
+155.2
setEvent((a,b,c){i=(a==this)?this:return document.getElementById(a);i.on+b=c}})
+166.4
function InitializeSubmenu(submenucontainerid, tablecellroid, tablecellid, fname) {
var s = "";
s = s + "function " + fname + "() { ";
s = s + "document.getElementById(submenucontainerid).style.visibility='';";
s = s + "BringToFront(submenucontainerid);";
s = s + "}";
if ((index = navigator.userAgent.indexOf("MSIE")) >= 0)
s = s + "document.getElementById('" + tablecellid + "').attachEvent(\"onmouseover\", " + fname + ");";
else
s = s + "document.getElementById('" + tablecellid + "').addEventListener(\"mouseover\", " + fname + ", true);";
s = s + "document.getElementById(tablecellroid).onclick = function() {";
s = s + "if( document.createEvent ) {";
s = s + "var evObj = document.createEvent('MouseEvents');";
s = s + "evObj.initEvent( 'click', true, false );";
s = s + "document.getElementById(tablecellid).dispatchEvent(evObj);";
s = s + "} else if( document.createEventObject ) {";
s = s + "document.getElementById(tablecellid).fireEvent('onclick');";
s = s + "}";
s = s + "}";
eval(s);
}
Как говориться, "eval() is evil" :-)
http://stackoverflow.com/questions/197769/when-is-javascripts-eval-not-evil
+165.7
function sendClicked(F)
{
var binary = document.getElementById("binary");
var binary_file = binary.value;
var binary_len = binary_file.length;
if(binary_file == ""){
binary.focus();
alert('File name can not be empty !');
return false;
}
else {
if(binary_len<=4) {
binary.focus();
alert('File is wrong !');
return false;
}
if(binary_file.charAt(0) != '/') {
if(binary_file.charAt(1) != ':') {
binary.focus();
alert('File is wrong !!');
return false;
}
}
if(binary_file.charAt(binary_len-4) != '.') {
binary.focus();
alert('File is wrong !!');
return false;
}
if(binary_file.charAt(binary_len-3) != 'B') {
if(binary_file.charAt(binary_len-3) != 'b') {
binary.focus();
alert('File is wrong !!');
return false;
}
}
if(binary_file.charAt(binary_len-2) != 'I') {
if(binary_file.charAt(binary_len-2) != 'i') {
binary.focus();
alert('File is wrong !!');
return false;
}
}
if(binary_file.charAt(binary_len-1) != 'N') {
if(binary_file.charAt(binary_len-1) != 'n') {
binary.focus();
alert('File is wrong !!');
return false;
}
}
show_div(true, "progress_div");
progress();
return true;
}
}
</script>
Со странички обновления прошивки DWL-G700AP. Из-за этого говнокода прошивается только из internet explorer.
+154.4
function _patchManualImagesClasses() {
var images=document.getElementsByTagName('img');
var re0=/^image_image_\d+$/;
var re1=/^image_middle_\d+$/;
var re2=/^image_small_\d+$/;
for(var i=0; i<images.length; i++ ) {
var id=images[i].id;
if (re0.test(id) || re1.test(id) || re2.test(id) ) {
var _m=images[i];
var align=_m.getAttribute('align');
var iClass=_m.getAttribute('className');
if (iClass == null || iClass.length==0 ) {
iClass=_m.getAttribute('class');
};
if (iClass==null || iClass.length==0 ) {
_m.setAttribute('class', 'content_img_'+align);
_m.setAttribute('className', 'content_img_'+align);
};
};
};
};
function _patchManulImagesClasses() {
_patchManualImagesClasses();
};
Первая функция нужна только ради того, чтобы для картинок сделать 10px отступ через CSS. А вот вторая — понятия не имею зачем она написана. Причем, нигде на сайте _patchManulImagesClasses, конечно, не используется.
Господи, спасибо Тебе, что дал нам Джона Резига и jQuery!