MySpace Open Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

IE problems

Last post 07-05-2009 10:54 PM by Chris Cole. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-25-2009 7:12 AM

    IE problems

    The following code works fine on FF but on IE has a problem ... data.hadError() is always true... why? And how can I solve that. Thanks !

     

    function init() {
        //1: Create the DataRequest.
        var request = opensocial.newDataRequest();

        var fields = [
                        opensocial.Person.Field.HAS_APP,
                        opensocial.Person.Field.NAME,
                        opensocial.Person.Field.NICKNAME,
                        opensocial.Person.Field.PROFILE_URL];
        // add the supported fields to the parameter list.
        var params = {};
        params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] = fields;    
        
        //2: Prepare RequestItems to be added to the DataRequest
        
        // add the fetch person request to the queue.
        request.add(request.newFetchPersonRequest(opensocial.IdSpec.PersonId.VIEWER, params), "viewer");

        request.send(startResponse);
    }
    function startResponse(data) {
        if (data.hadError()) {
            //document.getElementById('add').style.display = "block";
            var msg = "Error Occurred<br/>You MUST refresh whole window in order to load the game, would like to do it now?";
            errorPageInit(msg);
        } else {
            var viewer = data.get("viewer");
            if (viewer.hadError()) {
                errorCode = viewer.getErrorCode();
                //errorPage(errorCode);
                if(errorCode == opensocial.ResponseItem.Error.FORBIDDEN || errorCode == opensocial.ResponseItem.Error.UNAUTHORIZED){
                    document.getElementById('add').style.display = "block";
                }
            }
            else {
                // START APP
            }
        }
    }

    Filed under:
  • 07-05-2009 10:54 PM In reply to

    Re: IE problems

     It seems to work fine in IE8.  If you're using IE7 you'll likely need to get some debugger to attach and diagnose what's going on.  If you look into the data response and the sub-objects the error messages are usually pretty helpful

Page 1 of 1 (2 items)