当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - 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 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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: