Skip to content

Instantly share code, notes, and snippets.

@captproton
Created September 29, 2010 18:12
Show Gist options
  • Select an option

  • Save captproton/603222 to your computer and use it in GitHub Desktop.

Select an option

Save captproton/603222 to your computer and use it in GitHub Desktop.
YAHOO.util.Connect.asyncRequest("GET", "http://developer.yahoo.com/yui/examples/carousel/assets/php/getimages.php", {
success: function (o) {
var i, r = eval('(' + o.responseText + ')');
curpos = r.length;
for (i = 0; i < curpos; i++) {
items.push(r[i]);
}
// check if the Carousel widget is available
if (typeof carousel != "undefined") {
for (i = 0; i < curpos; i++) {
// if so, shove the elements into it
carousel.addItem(getImageTag(items[i]));
}
carousel.set("selectedItem", 0);
items = [];
}
},
failure: function (o) {
alert("Ajax request failed, George!");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment