Loading...
Как сделать запрос на js файл? Пытаюсь сделать кнопку с помощью js, но так и не понял что к чему. Я в этом мало что понимаю, и поэтому надеюсь на вашу поддержку вот сам код js


function sendComment(id_post){
if($('#textarea-'+id_post).val().length<2){
alert('Введите более двух символов');
return false;
}

$("#info-comm-"+id_post).hide();
$("#comments-loading-"+id_post).show();
$.post('/ussr/guestbook/guest_index.php?uid=<?= $ank['id'] ?>',{'message':$('#textarea-'+id_post).val(), 'id_post': id_post},function(resp){
$("#comments-"+id_post).html($("#comments-"+id_post).html()+resp).find('tr').fadeIn();
$("#info-comm-"+id_post).show();
$("#comments-loading-"+id_post).hide();
$('#textarea-'+id_post).val('')
});
}
function editPostShow(id_post){
$('#edit-'+id_post).show();
$("#content-"+id_post).hide();
}
function editPostSend(id_post){
$("#edit-"+id_post).find('img').show();
$.post('/ussr/guestbook/guest_index.php?uid=editPost',{'message':$('#edit-'+id_post).find('textarea').val(), 'id_post': id_post},function(resp){
$('#edit-'+id_post).hide();
$("#edit-"+id_post).find('img').hide();
$('#content-'+id_post).html(resp).show();
});

}

function repost(id_post){
$("#repost-"+id_post).attr('onclick','').html('<img src="/style/icons/ajax-loader.gif"/>');
$.post('/wall-ajax.php?act=repost',{'id_post': id_post},function(resp){
$("#repost-"+id_post).html(resp);
});

}

function like(val,id_post){
$('#likes-'+id_post).slideUp('100');
$.post('/wall-ajax.php?act=like',{'value':val, 'id_post': id_post,'module':'wall'},function(resp){
$('#likes-'+id_post).slideDown('100').html(resp);
});
}
function like_c(val,id_post){
$('#likes-comm-'+id_post).slideUp();
$.post('/user/guestbook/guest_index.php?act=like',{'value':val, 'id_post': id_post,'module':'wall_comments'},function(resp){
$('#likes-comm-'+id_post).slideDown().html(resp);
});
}


И есть ли возможность сразу все кнопки imput настроить так чтобы они работали без перезагрузке, проблема в том что я запрос ни как сделать не могу. Дайте плс решение данной проблемы
$(document).on('click','тут ид или класс кнлпки', function(){ тут вызывает что тебе необходимо}); прости если не понятно просто с телефона не удобно.
________
посл. ред. 23.12.2019 в 06:45; всего 1 раз(а); by 138759397
138759397 , сможешь позже пример дать?
Онлайн: 2
Время:
Gen. 0.1171
(c) Bym.Guru 2010-2026