I'm trying to make a drop-down box with different RSS feeds so users can choose what news feed they want to view. I was originally using this tool to automatically build the structure of the news into my website:
http://commons.ucalgary.ca/feed2js/build.php
To integrate it how it is normally you would go
Code:
<script language="JavaScript" src="http://commons.ucalgary.ca/feed2js/feed2js.php?src=URLTHEYPROVIDEYOU" type="text/javascript"></script>
example: http://radgh.com/test.html
Now I'd like to be able to change these with a drop down menu between a few feeds. One way would be to load each feed in a hidden div and show the appropriate one, but I fear this would cause long load times for users on slow connections.
Is there a way to execute javascript from an external "src" while inside a javascript function, an "If else" statement. For example:
Code:
function changeFeed(src) {
if (src == "nytimes") {
document.getElementById("newsbox").executeURL = "www.a url here.com";
}
if (src == "popurls") {
document.getElementById("newsbox").executeURL = "www.a url here.com";
}
}
</script>
I thought AJAX would work well, but I don't think AJAX actually executes the data. Plus, I'm not very good with AJAX.
|