开发者

jFeed problem: modifying global variable from success function

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 th开发者_如何学Pythone 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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜