RSS FEED从本地rss文件读取

时间:2013-04-27 15:49:51

标签: jquery rss jscript

我正在尝试从bbc.com上阅读rss feed。 我成功地从bbc.com上阅读了ess。 但是当我从本地计算机上读取rss时.. RSS未找到... 我的代码在这里......

    <?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Weather</title>
<link>local://localhost/ali/WeatherApp/</link>
<description>Weather Update Website</description>
<item>
  <title>Entry Title</title>
  <link>Link to the entry</link>
  <guid>http://example.com/item/123</guid>
  <pubDate>Sat, 9 Jan 2010 16:23:41 GMT</pubDate>
  <description>[CDATA[ This is the description. ]]</description>
</item>
</channel>
</rss>

Jquery代码是

 <link href="jquerymobile/jquery.mobile-1.3.1.css" rel="stylesheet" type="text/css"/>
<link href="zrssfeed/jquery.zrssfeed.css" rel="stylesheet" type="text/css" />

<script src="jquerymobile/jquery.js" type="text/javascript"></script>
<script src="jquerymobile/jquery.mobile-1.3.1.js" type="text/javascript"></script>

<script src="jquery.zrssfeed.min.js" type="text/javascript"></script>
<script src="zrssfeed/jquery.zrssfeed.min.js" type="text/javascript"></script>
<script type="text/javascript">
var selectVal="";
$(document).ready(function () {

    //var conceptName = $('#select_menu :selected').text();

    //$('#select_menu').change(function() {
   // assign the value to a variable, so you can test to see if it is working
   // selectVal = $('#select_menu :selected').val();
    //alert(selectVal);
//});
    //var conceptName = $("select_menu").filter(":selected").val();
    $("#Submit").click(function(){
    selectVal = $('#select_menu :selected').val();
    if(selectVal=='New York')
    {
    $('#test').rssfeed('http://demo.sslwireless.com/apk/rss.xml'); 
    }
    else if(selectVal=='London')
    {
    $('#test').rssfeed('http://open.live.bbc.co.uk/weather/feeds/en/2643743/observations.rss'); 
    }
    else if(selectVal=='Moscow')
    {
    $('#test').rssfeed('http://open.live.bbc.co.uk/weather/feeds/en/524901/observations.rss'); 
    }
    else if(selectVal=='Tokyo')
    {
    $('#test').rssfeed('http://open.live.bbc.co.uk/weather/feeds/en/1850147/observations.rss'); 
    }

        //alert(selectVal);
        });
});

</script>

任何人都可以帮忙吗??

0 个答案:

没有答案