jFeed problem: modifying global variable from success function

209 Views Asked by At

I am using jFeed to parse an RSS feed and I would like to modify an outside variable (or array) from the function executed upon "success". This is a simple version of the code:

var testVariable = "Original";

jQuery.getFeed({
   url: rssFeed,
   success: function(feed) {
      testVariable = "New Value";
   }
});

When I output "testVariable", it still has the original value "Original". Is something wrong with my code?

The purpose of this is to apply the same logic to an array instead of a variable, so I can load the feed's contents into a global Javascript array.

Any help will be greatly appreciated.

0

There are 0 best solutions below