I have a problem with the plugin Vegas.js
, when calling my images from the database, I can not see them, they do not appear in the plugin, but I do a console.log
and I copy the text in the plugin if appear, this is my code:
$.get('ajax/slides.php', function(data) {
$('#slideMain').vegas({
slides: [ data ]
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
AJAX file
$slide = new slideManager();
$slide ->showSlideController();
PHP
public function showSlideController()
{
$answer = slideModel::showSlideModel("slides");
foreach($answer as $row => $item){
echo '{ src: "'.$item['path'].'" },'; // Incluso asi no funciona
}
}
If someone could tell me what I'm doing wrong, I'd really appreciate it