I have this script
<script type="text/javascript" src="customJS/jsonRetrieve.js" async></script>
The script makes me retrieve the data from a JSON file and store it in an array.
first question is: how can i load my index page only after the script is fully loaded? i get the error of 'undefined'.
After loading the script i have to add the code from the array something like this
"<img src='images2/1.jpg' id='0' style='width:70%' class='rounded' data-toggle='modal' onclick='setMod(this.id);setData(this.id)' data-target='#myModal' />"
to my carousel and that by adding it to the div. I used the jQuery function 'append' to add the images to my #carousel div but the images are not showing in the carousel preview. how can i fix that ? should i refresh the carousel ?
<script type="text/javascript" src="js/jquery.waterwheelCarousel.js" defer></script>
<script type="text/javascript" src="customJS/carouselJS.js" defer></script>
$(window).load(function () {
$('#carousel').append(items[0]);
});