hello all, I am having difficulty with getting data I am accessing via $.get to return what that gets back into my html page. I can get the data I want to access to pop up into a javascript alert box, I just can get it back my existing html page, hoping someone might be able to take a look and show me what I am doing wrong...
http://pastie.org/private/elb1etjlvdhxf3ojittmsw this is my first jquery/ajax experiment.
I've also been told that I need to create a function that will allow for html content to be loaded into the carousel, I am using jcarousel and the html content I load I am trying to load it into the carousel, where as it is actually created for images. My code is here:
and jcaraousel examples and doc is here.
Any help or recommendation of other carousels that allow html content loading would be great.
My code below
// function to access the .txt data source
function loadItemHandler(carousel, start, last, available)
{
if (available) {
// Trigger loaded
carousel.loaded();
return;
}
var cr = carousel;
jQuery.get("example_dynamic_ajax.txt", function(data) {
appendItemCallback(cr, start, last, data);
});
};
//example_dynamic_ajax.txt example of file below
page1.html;Nameof1|
page2.html;Nameof2|
page3.html;Nameof3|
// grabbing the url from the txt, getting the html pages data, and (trying) to print it
function getItemHTML(data)
{
var split = data.split(";");
var url = jQuery.trim(split[0]);
var title = jQuery.trim(split[1]);
$.get(url, function(data){
alert("Data Loaded: " + data); //the data I want shows in an alert box like this, but I cant get it to print back in my page!
//what I have tried
//return data;
//return url(data);
//return ("DataLoaded:" + data);
});
//what I have tried
//return url(data);
//return (data);
};