Loading...
JavaScript | нужна библиотека js
не хочет работать скрипт, в песочнице все ок, а в документе html не хочет
я так понял нужна библиотека, какую мне нужно скачать ?
javascript

var i = 10;
$('#mama').click(function(){
    $that = $(this);
    $('#sestra').val(i++);
    $that.prop('disabled',true);
    setTimeout(function(){
        $that.prop('disabled',false);
    }, 5000);
});

<button id="mama">Кнопка</button>
<input id="sestra" type="text" value="Сестра">

пробовал эти не помогло:

<script src="http://code.jquery.com/jquery-1.10.2.js">
<script src="http://code.jquery.com/ui/1.11.2/jquery-ui.js">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js">

сама песочница https://jsfiddle.net/Deonis/DptA7/
pyrokinesis (14 сен 2023, в 16:11)
не хочет работать скрипт, в песочнице все ок, а в документе html не хочет
я так понял нужна библиотека, какую мне нужно скачать ?
javascript

var i = 10;
$('#mama').click(function(){
    $that = $(this);
    $('#sestra').val(i++);
    $that.prop('disabled',true);
    setTimeout(function(){
        $that.prop('disabled',false);
    }, 5000);
});

<button id="mama">Кнопка</button>
<input id="sestra" type="text" value="Сестра">

пробовал эти не помогло:

<script src="http://code.jquery.com/jquery-1.10.2.js">
<script src="http://code.jquery.com/ui/1.11.2/jquery-ui.js">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js">

сама песочница https://jsfiddle.net/Deonis/DptA7/
я сделал кнопка додает +1 верно
________
посл. ред. 14.09.2023 в 16:17; всего 1 раз(а); by 624534626
Лучший ответ
php
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function() {
   var i = 10;
 $('#mama').click(function(){
     $that = $(this);
     $('#sestra').val(i++);
     $that.prop('disabled',true);
     setTimeout(function(){
         $that.prop('disabled',false);
     }, 5000);
 });
});

</script>
<button id="mama">Кнопка</button>
 <input id="sestra" type="text" value="Сестра">
624534626 [!] (14 сен 2023, в 16:20)
php
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function() {
   var i = 10;
 $('#mama').click(function(){
     $that = $(this);
     $('#sestra').val(i++);
     $that.prop('disabled',true);
     setTimeout(function(){
         $that.prop('disabled',false);
     }, 5000);
 });
});

</script>
<button id="mama">Кнопка</button>
 <input id="sestra" type="text" value="Сестра">
работает, но есть один минус про который я забыл, (((((
после обновления страницы скрипт сбивается (((
как бы сделать так что бы таймаут сохранялся в куках например?
поможешь?
pyrokinesis (14 сен 2023, в 16:27)
работает, но есть один минус про который я забыл, (((((
после обновления страницы скрипт сбивается (((
как бы сделать так что бы таймаут сохранялся в куках например?
поможешь?
цена вопроса?
624534626 , пиши цену в почту а я подумаю.
pyrokinesis ,
php


<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function() {
    var i = getCookie('counter') || 10;
    $('#sestra').val(i);
    $('#info').click(function() {
        $that = $(this);
        $('#sestra').val(i++);
        $that.prop('disabled', true);
        setTimeout(function() {
            $that.prop('disabled', false);
        }, 5000);
        setCookie('counter', i, 30);
    });
    function setCookie(name, value, days) {
        var expires = '';
        if (days) {
            var date = new Date();
            date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
            expires = '; expires=' + date.toUTCString();
        }
        document.cookie = name + '=' + value + expires + '; path=/';
    }
    function getCookie(name) {
        var nameEQ = name + '=';
        var ca = document.cookie.split(';');
        for (var i = 0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0) == ' ') c = c.substring(1, c.length);
            if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
        }
        return null;
    }
});
</script>
<button id="info">Кнопка</button>
<input id="sestra" type="text" value="Сестра">


624534626 [!] (14 сен 2023, в 16:32)
цена вопроса?
вы на доске сэр
і шо мне теперь не жить, илы не зарабативать. СЭР...
624534626 [!] (14 сен 2023, в 16:48)
і шо мне теперь не жить, илы не зарабативать. СЭР...
Мультиаккаунтом занимаешься, все твои ники на доске. Не умничай тут.
Онлайн: 2
Время:
Gen. 0.072
(c) Bym.Guru 2010-2026