Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8575359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:40:35+00:00 2026-06-11T19:40:35+00:00

I am reading an rss file with jquery ajax function in the success i

  • 0

I am reading an rss file with jquery ajax function in the success i create the array function mycarousel_itemList and fill it with items using push. I want to use this array in a function that I created then, but I get the error:

mycarousel_itemList is not defined

What’s going wrong?

<script type="text/javascript">
var rss = 'http://search.issuu.com/userxxx/docs/recent.rss';
$.ajax({
type: 'GET',
url: 'js/issuuGallery/proxy.php?url='+rss,
dataType: 'xml',
success: function(xml) {
    var ul = document.createElement("ul");
    ul.setAttribute('id', 'issuu-gallery');
    ul.setAttribute('class', 'overview');

    $(xml).find('item').each(function(){
        var mycarousel_itemList = [];
        var id = $(this).find('[name="documentId"]').attr('value');
        var src = 'http://image.issuu.com/'+id+'/jpg/page_1_thumb_small.jpg';
        mycarousel_itemList.push(src);
        console.log(mycarousel_itemList);
    });
}
});
function mycarousel_itemLoadCallback(carousel, state)
{

for (var i = carousel.first; i <= carousel.last; i++) {
    if (carousel.has(i)) {
        continue;
    }

    if (i > mycarousel_itemList.length) {
        break;
    }

    carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[i-1]));
}
   };

/**
 * Item html creation helper.
 */
function mycarousel_getItemHTML(item)
{
return '<img src="' + item.url + '" width="75" height="75" alt="' + item.url + '" />';
};

jQuery(document).ready(function() {
jQuery('#mycarousel').jcarousel({
    size: mycarousel_itemList.length,
    itemLoadCallback: {onBeforeAnimation: mycarousel_itemLoadCallback}
});
});

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:40:37+00:00Added an answer on June 11, 2026 at 7:40 pm

    I’m assuming you’re just loading the rss feed once then creating a carousel with the result. If so, this is easy to fix.

    1. Look for this line:

      var mycarousel_itemList = [];
      

      That is creating a local variable inside the ajax success callback. What you’ll want to do is make it global and move it to the top (make it the very first line inside the < script> tag).

    2. Move the $.ajax call to inside the document ready callback.

    3. Find the following jcarousel code:

      jQuery('#mycarousel').jcarousel({
          size: mycarousel_itemList.length,
          itemLoadCallback: {onBeforeAnimation: mycarousel_itemLoadCallback}
      });
      

      Move it to inside the $.ajax callback as the last thing in the callback.

    Your final code should look like this: http://jsfiddle.net/h35VQ/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am reading a RSS feed into nsmutablearray. i want to search the xml
I'm reading a rss feed using simple code: <?php $homepage = file_get_contents('http://www.forbes.com/news/index.xml'); $movies =
I'm reading and store a RSS feed in my database.I'm using this code <?php
I am reading yahoo weather xml file <rss version=2.0 xmlns:yweather=http://xml.weather.yahoo.com/ns/rss/1.0 xmlns:geo=http://www.w3.org/2003/01/geo/wgs84_pos#> <channel> <title>Yahoo! Weather
I'm trying to create some xml , basically by reading rss feeds and adding
I am reading a Rss feed using setInterval method and displaying notification to the
I was trying out this tutorial for reading rss feeds with a php file
I am reading this tutorial on fetching RSS feeds using PHP Simple XML. Reason
I am reading the news.ycombinator RSS feed using python and storing them in a
$fp = fopen(http://feeds.reuters.com/Reuters/PoliticsNews?format=xml,r) or die(Error reading RSS data.); The above coding working correctly in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.