开发者

jFeed problem: modifying global variable from success function

开发者 https://www.devze.com 2023-02-04 17:56 出处:网络
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:

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

精彩评论

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