I'm using AJAX, javascript and PHP to make calls and receive data back that I then want to display on a web page. My calls are working fine and I am receiving data back, my problem lies with trying to write the data to a jCarousel.
Whatever I do I can't appear to write to the jcarousel list items from my javascript. My javascript is in a separate .js file.
I've tried all sorts of combinations this is my latest:
.JS FILE within my handleResponse function:
var ul = document.getElementById("testerid");
ul.style.display = 'block';
var li = document.createElement("li");
var litext = document.createTextNode("test");
li.appendChild(litext);
ul.appendChild(li);
.php FILE:
<ul class="carels jcarousel-skin-tango" id="testerid" >
</ul>
In my HEADER:
<script>
$(document).ready(function() {
$('.carels').jcarousel({
vertical: true
});
});
</script>
Result combinations I've had:
With the combination of code above I appear to get a functioning carousel - the arrows are there and are clickable and there is a boxed area between them, but no list items are visible on the page. If I include a <li></li> tag within the <ul> tag on my php page I get a visible list but the carousel doesn't function.
Thanks for any help anyone can give.