New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Database issue #166
Comments
Hello. 1/ PHP must generate a standard JSON array with src inside Hope it helps. |
Hello, thanks for the reply, look, the problem is that i dont know how to add them to Vegas properly, i have my JSON array and i got the images, for example, if i do this to test the JSON : $('#slideMain').append('<img src="'+slides["path"]+'">'); i see all the images, however if i do the same in Vegas, it only displays the first image, and if i left it like: {src: slides}, it only shows me an string with console.log. Here is the code if it helps : foreach($answer as $row => $item){ And in JS $.getJSON('ajax/Slides.php', function(slide) { Thanks again for all your help =D |
Your keys and json structure seems wrong. |
Cuz is the only column that i need from the gallery table, in that table i
have 3 columns: id,path,order, so i dont need id nor order.
When i do a console.log i got this:
![captura de pantalla 3](https://user-images.githubusercontent.com/35807468/35435386-cd229f2c-028a-11e8-8817-85067adc1c97.png)
2018-01-26 10:32 GMT+01:00 Jay Salvat <notifications@github.com>:
… Your keys and json structure seems wrong.
why 'path' ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#166 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AiJg7ILIr3FfFoPyGwWhGowEEai2FmLgks5tOZu-gaJpZM4RtGWa>
.
|
Give Vegas the JSON it needs and it will work :) |
Ok, i will see what can i do, thanks again for all your help =) Best regards =D |
Hello, im using your plugin but i have a problem, i call my images from the database and pass them to the plugin but it doesnt read them, however if i copy what is inside the array of images into the plugin it works. Here is my code :
JS
$.get('ajax/slides.php', function(data) {
$('#slideMain').vegas({
slides: [ data ]
});
});
////////////////////////////////////////////
AJAX file
$slide = new slideManager();
$slide ->showSlideController();
echo $slide;
//////////////////////////////////////////
PHP
public function showSlideController(){
$answer = slideModel::showSlideModel("slides");
foreach($answer as $row => $item){
echo '{ src: "'.$item['path'].'" },'; // Even if i print it like this doesnt work
}
}
////////////////////////////////////////
Again i got all my images but they are not displayed in the plugin,
Any help will be more than welcome, thanks in advance =D
The text was updated successfully, but these errors were encountered: