MySpace Open Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

makeRequest doesn't work with ie7

Last post 02-25-2009 11:50 AM by rondata. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 02-17-2009 2:58 PM

    • GioZ
    • Not Ranked
    • Joined on 10-16-2008
    • Posts 1

    makeRequest doesn't work with ie7

    Hello, i'm trying to reed a feed rss with opensocial 0.7. It works fine with all browser but doesn't work with ie7. The error is "method not supported". Here is the code I use:


    function getRss()
    {
      var params = {};
      params[opensocial.ContentRequestParameters.CONTENT_TYPE] = opensocial.ContentRequestParameters.ContentType.XML;
      opensocial.makeRequest("http://www.esternando.it/site/blog/rss.aspx?idCat=0", makeRequest_callback, params);  

    /* I ALSO TRYIED THIS CODE BUT DOESN'T WORK, i think the error is always becaused the Microsoft.XMLDOM object fails the loadXML method

    params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.FEED;
    gadgets.io.makeRequest(http://www.esternando.it/site/blog/rss.aspx?idCat=0, makeRequest_callback, params);*/


    }
    function makeRequest_callback(response , url, error)
    {
     if (response == null)
        { 
             return;
        } 
        
        var html = new Array();
        var itemList = response.getElementsByTagName("item");
    }

       


    I found the error in makeRequest function, that fail the loadXML method of Microsoft.XMLDOM ActiveX object, so the response is only a string, not the DOM, so it doesn't have the getElementsByTagName method. How can I resolve this problem? The RSS feed seems to be correct (other browser load correctly the feed), so I can't understand why Microsoft.XMLDOM is unable to load the file...

    help please....

     

  • 02-20-2009 5:19 AM In reply to

    Re: makeRequest doesn't work with ie7

    We'll check it out, thanks for the feedback 

  • 02-20-2009 11:18 AM In reply to

    Re: makeRequest doesn't work with ie7

     I worked with this for a bit and it looks like the Microsoft.XMLDOM object doesn't like some of the charactures in the returned data.

    I tried the following code to debug:

     

    <script type="text/javascript">
    function getRss()
    {
     
      var params = {};
     
      params[opensocial.ContentRequestParameters.CONTENT_TYPE] = opensocial.ContentRequestParameters.ContentType.XML;
      opensocial.makeRequest("http://www.esternando.it/site/blog/rss.aspx?idCat=0", makeRequest_callback, params); 

    /*
    I ALSO TRYIED THIS CODE BUT DOESN'T WORK, i think the error is always becaused the Microsoft.XMLDOM object fails the loadXML method

    params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.FEED;
    gadgets.io.makeRequest("http://www.esternando.it/site/blog/rss.aspx?idCat=0", makeRequest_callback, params);
    */

    }
    function makeRequest_callback(response , url, error)
    {
    var nodes;

    if(window.ActiveXObject)
    {

      //load the Document in IE

       xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.async="false";
        xmlDoc.loadXML(response.text);
        nodes = xmlDoc.getElementsByTagName("item");
    }
    else
    {

        //Load the document in Firefox

       parser = new DOMParser();
        xmlDoc=parser.parseFromString(response.text,"text/xml");
        nodes = xmlDoc.getElementsByTagName("item");
    }

    nodes[1];
    }
    getRss();

    </script>

     

    I am not sure which chars are causing the problem, but I was to alter the returned document to only contain simple strings and it worked fine.  You are going to need to figure out which chars are causing the problem, figure out how to strip them out and then feed the text into the above code.

     

    -Justin

     

  • 02-23-2009 7:39 PM In reply to

    Re: makeRequest doesn't work with ie7

     Hey there, still waiting for an answer, thanks for the additional feedback

    Rhonda

     

  • 02-25-2009 11:50 AM In reply to

    Re: makeRequest doesn't work with ie7

     Can you either copy me or msg the xml and include the app ID. :)

    Thanks.

Page 1 of 1 (5 items)