- 1
- 2
- 3
function returnFalse() {
return false;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+161
function returnFalse() {
return false;
}
+147
Если вам нужно запустить скрипт написанный на jQuery по окончанию загрузки страницы
$(document).ready( function(){
// ну и тут ваш код
});
Преимущество это метода, в том, что он исполняет скрипт по окончанию загрузки кода страницы, НЕ включая флеш баннеры и видео.
Увидел на одном сайте, который "учит" jQuery
+153
<form method="POST" id="acceptaction" action="/">
<input type="submit" value="Принять участие" name="startUserEvent" />
<input type="hidden" value="62" name="userid" />
</form>
<div id="result"></div>
jQuery(document).ready(function()
{
jQuery("#acceptaction").submit(function(event)) {
event.preventDefault();
var form = jQuery( this ),
term = form.find( 'input[name="userid"]' ).val(),
url = form.attr( 'action' );
jQuery.post( url, { userid: term },
function( data ) {
var content = jQuery( data ).find( '#content' );
jQuery( "#result" ).empty().append( content );
};
);
};
});
+158
$('#home').click(function(){
$.get("q.php", { id: 1 }, function(data){
$('#content').html(data);
});
});
$('#programz').click(function(){
$.get("q.php", { id: 2 }, function(data){
$('#content').html(data);
});
});
$('#contactz').click(function(){
$.get("q.php", { id: 3 }, function(data){
$('#content').html(data);
});
});
$('#aboutazz').click(function(){
$.get("q.php", { id: 4 }, function(data){
$('#content').html(data);
});
});
$('#chatz').click(function(){
$.get("q.php", { id: 5 }, function(data){
$('#content').html(data);
});
});
$('#advertisement').click(function(){
$.get("q.php", { id: 6 }, function(data){
$('#content').html(data);
});
Jquery во всей красе.
+147
function checkAllRemarks()
{ // ЧТО ЭТО!?!?!?!?17СЕМНАДЦАТЬ!!!!1111
for (i = 0; i < document.getElementsByTagName("input").length; i++)
{
if (document.getElementsByTagName("input")[i].name.split("|").length>=2)
{
if (document.getElementsByTagName("input")[i].name.split("|")[0]=="CBR")
{
if (document.getElementsByTagName("input")[i].name.split("|")[1].length==36)
{
if (document.getElementsByName("allRemarks")[0].checked == true)
document.getElementsByTagName("input")[i].checked = true;
else
document.getElementsByTagName("input")[i].checked = false;
}
}
}
}
}
+152
if ('yes'!= 'yes') {
checkCaptcha();
return true;
}
+147
function check() {
if (document.login.user.value == "user" &&
document.login.password.value == "correct_password")
window.location.href = 'http://this.site/login.html';
else
window.location.href = 'http://this.site/loginfehler.html';
return false;
}
+147
function nyak_nyak(el) {
if (confirm("Вы уверены в своих действиях?")) {
document.location = el.href;
}
return false;
}
+147
if(typeof n!="number"&&(k==Number||!(n instanceof Number))||p.round(n)!=n||n==NaN||n==Infinity)return!1;
+147
var yagooduser = sustr('Мой',1);
Чел прислал в асю и удивляется, почему не работает