Domanda

I'am scrittura di un codice utilizzando Google-Ajax-Feed-API per ottenere feed dal sito. Qui è il mio codice per lo stesso.

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
        <title>Google AJAX Feed API - Simple Example</title>
        <script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAA5MxjlekOJilywavs2TkrKxR3jjpvUIxSLOdaAPuufKrvVh6s1RSHnixBY86Q-Ze6bbbVdDtzvnIORA"></script>
        <script type="text/javascript" src="jquery-1.4.2.min.js"></script>
        <script type="text/javascript">

            google.load("feeds", "1");
            function initialize() {
                feed = new google.feeds.Feed("http://feeds.labnol.org/labnol");
                feed.load(function(result)
                {
                    if (!result.error)
                    {
                        var container = $("#feed");
                        for (var i = 0; i < result.feed.entries.length; i++)
                        {
                            var entry = result.feed.entries[i];
                            var header = $("<h2> <input type=\"checkbox\" name=\"rssItem\" /><span class=\"title\"> "+entry.title+" </span> </h2>");
                            var dataStr = $("<em class=\"date\">"+entry.publishedDate+"</em><p class=\"description\">"+entry.contentSnippet+"</p><a target=\"_blank\" href=\""+entry.link+"\">Read more...</a>");
                            var divObj = $("<div></div>");
                            header.appendTo(divObj);
                            dataStr.appendTo(divObj);
                            divObj.appendTo(container);
                        }
                    }
                });    
            }
            google.setOnLoadCallback(initialize);
    </script>
    </head>
    <body>
        <div id="feed"></div>   
    </body>
</html>

Questo funziona perfettamente in Mozilla, ma non in IE. Qualcuno può dirmi che cosa è che non va in IE?

È stato utile?

Soluzione

Molto strano problema, non appena ho cambiato

feed = new google.feeds.Feed("http://feeds.labnol.org/labnol");

a

var feed = new google.feeds.Feed("http://feeds.labnol.org/labnol");

tutto inizia a lavorare come previsto in IE.

Grazie comunque.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top