954,604 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Change javascript into html

I have an RSS feed that is called using javascript. What I would like to happen is that the information gets displayed as html when you view source instead of the javascript.

Here's the javascript:

<script type="text/javascript" onload="$('div.rssBody').vTicker();">
$(document).ready(function () {
	$('#ticker1').rssfeed('http://feeds.bbc.co.uk/iplayer/highlights/tv',{}, function(e) {
		$(e).find('.homepageupdates').vTicker();

	});
});
</script>

<div id="ticker1"></div>


I'm guessing there is some php function that will be able to extract the info from this the source before the javascript gets to it.

Any help greatly recieved. Thank you

cambraydesign
Newbie Poster
7 posts since Nov 2009
Reputation Points: 10
Solved Threads: 0
 

am I right that you are looking for a php rss parser?
there are alot of them
here is a short list
but there are many more (google)

pzuurveen
Posting Whiz in Training
229 posts since Sep 2006
Reputation Points: 32
Solved Threads: 47
 

Right ok, I have a parser now and I'm using wordpress. The parser uses shortcodes so I now need to integrate the shortcode into the javascript.

The javascript code is the same as above and needs to have this short code in it:

[parse_feed feed="http://feeds.bbc.co.uk/iplayer/highlights/tv" num="8" ]


I have tried this:

<script type="text/javascript">
$(document).ready(function () {
	$('#ticker1').rssfeed(<?php echo do_shortcode('[parse_feed feed="http://feeds.bbc.co.uk/iplayer/highlights/tv" num="8" ]'); ?>,{}, function(e) {
		$(e).find('div.rssBody').vTicker();
	});
});
</script>


But this isn't working!

Thanks for any help anyone can give. Thanks for the parser suggestion too!!

cambraydesign
Newbie Poster
7 posts since Nov 2009
Reputation Points: 10
Solved Threads: 0
 

if you are using wordpress why not use a plugin for this?
http://wordpress.org/extend/plugins/search.php?q=rss+feed+reader

pzuurveen
Posting Whiz in Training
229 posts since Sep 2006
Reputation Points: 32
Solved Threads: 47
 

This plugin only gets the title from the feed whereas the other feed get the date and the first part of text in each feed article. But that is what I'm trying to achieve!! Thanks for your help!

cambraydesign
Newbie Poster
7 posts since Nov 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: