PDA

View Full Version : how to insert variable into a funtion



danskkr
03-28-2011, 01:36 PM
edit: opps.. 'function' not 'funtion'!

Hi,

I'm playing around trying to learn jquery from the wrong end and my general ignorance is starting to show...
I can't seem to figure out how to add a variable or in fact any kind of text string to the code below.

I'm trying to make an edit to an jquery RSS feed plug in:
gfeedfetcher (http://www.jquery4u.com/plugins/jquery-rss-feed-display-live/)
The bit in red is a variable i want to add and inset where the green text is as a URL. I just don't seem to know enough about the syntax needed to make it work. Is there a good way of adding the variable into the addFeed function?


<script type="text/javascript">
var newsfeed=new gfeedfetcher("rssfeeds", "rssfeedsclass", "_new")
var insertRSS=localStorage.getItem('RSS1')
newsfeed.addFeed("Ormiston School News", "http://www.ormistonsandwell.org.uk/RSS/News/");
newsfeed.addFeed("RSS FEED 1", "http://feeds.bbci.co.uk/news/science_and_environment/rss.xml");
newsfeed.addLocalFeed("Weather Feed", "http://newsrss.bbc.co.uk/weather/forecast/190/Next3DaysRSS.xml");
newsfeed.addLocalFeed("Dynamic Feed", RSSfeedOne);
newsfeed.displayoptions("label datetime snippet");
newsfeed.setentrycontainer("p");
newsfeed.filterfeed(10, "date");
newsfeed.init();
</script>
The actual addFeed function:

gfeedfetcher.prototype.addFeed=function(label, url){
this.feedlabels[this.feedlabels.length]=label
this.feedurls[this.feedurls.length]=url
}

thanks!