v2.5.2
Giriş yap

Php ["İtyped.js Ajax ile veri çekme"] ?

acemi
266 defa görüntülendi

bir türlü başaramadım ne yaptıysam olmadı yardımcı olurmusunuz kodlarım aşağıdaki gibididr

if(isset($_POST)){
    $data = array(); 
    $gel = $db->prepare("SELECT icerik FROM tablo ");
    $gel->execute(); 
    while ($gelsin = $gel->fetch(2)) { 
        $data[] =  array(
            'icerik' => $gelsin['icerik'] 
        ); 
    }
    echo json_encode($data);  
}
$(document).ready(function(){  
    $.ajax({
        url: "post.php",  
        type:'POST',  
        dataType: 'json',
        data:"duyuru", 
        success:function(response){  
            ityped.init('.ityped', {
                // strings: [response.icerik],
                strings: response.icerik,
                loop: true,
                typeSpeed: 50,
                backSpeed: 20,
                startDelay: 250,
                backDelay: 2000 
            })
             
        }
    }); 
});

bu haliyle Put your string here...| and enjoy
yazıyor ityped.js de tanımlı diye.
// strings: [response.icerik], alanı ile yaptığım zamana da

ityped.min.js:1 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'length')

hatasını alıyorum.

acemi
627 gün önce

@trsherlock teşekkür ederim vakit ayırdığın için yardımınla hallettim.