1

Please how can I change the feed URL in this script with link(href)

<script type="text/javascript">
$(document).ready(function () {
    $('#test').rssfeed('http://feeds.reuters.com/reuters/oddlyEnoughNews');
});
</script>
<div id="test"> </div>

See example here http://www.zazar.net/developers/jquery/zrssfeed/example.html

The test Div displays the content of the rss feed

I just want to be able to alter the rssfeed(url) by clicking links with diffrent rssfeed url

<a onclick ="rssfeed('http://feeds.cnn.com/News');"></a>
1
  • 2
    What does dynamically mean in your case? What is rssfeed? Where is the HTML for #test? Commented Nov 26, 2012 at 7:13

2 Answers 2

1

note sure how you'd want the link to load it, but I'm assuming on click so this is what I would do..

<script type="text/javascript">
$(document).ready(function () {
  $('.rss').click(function(){
    $('#test').rssfeed($(this).attr('href'));
  })
});
</script>

<a class="rss" href="http://feeds.reuters.com/reuters/oddlyEnoughNews">load rss</a>
<div id="test"> </div>
Sign up to request clarification or add additional context in comments.

Comments

0

As it is shown here: http://www.zazar.net/developers/jquery/zrssfeed/example_menu.html

One can simply change the feed by calling .rssfeed again.

1 Comment

I was going to write the same solution as Yohn did but he posted it first and it is already perfect so I let my answer how it is. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.