How can I pass jquery array into a function?
Hi,
I have a function that is called as below and works fine when I use comma seperated values for url as below:
$(".related-posts-container").rssFeed({
buildType: "Object", url: ['/testblog/topic/spark/rss.xml', '/teamblogs/topic/devops/rss.xml'], author: true,
relatedPosts: 5
}
It also works fine for a single URL passed from a variable as below
document.getElementById("bloghelper").innerHTML = array[0];
$(".related-posts-container").rssFeed({
buildType: "Object", url: $('#bloghelper').html(), author: true,
relatedPosts: 5
}
However, using the first example I want to pass each array value (url) to the url parameter from the array outside of the function (array).
I had to use the document.getElementById for the single url (string) to work. I am not a jquery expert and so don't fully understand why I had to do this.
How can I get the array to be passed as the first example?
Any help MUCH appreciated.
Thanks