MySpace Developer Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

Google Gadgets?

Last post 02-15-2008 2:52 PM by Chad Russell. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-14-2008 4:47 AM

    Google Gadgets?

    i really don't know how the name the subject.. anyway..

    i'm having this error in testing the Gifts - 4 - activities sample from the OpenSocial articles tutorial..

     error is:  window._IG_RegisterOnloadHandler is not a function

    there is a 0.7 version of it (that works on orkut) but I used the 0.6 version knowing that myspace implements (as of now) OpenSocial 0.6 

    the code I used:

          <script src="http://opensocial-resources.googlecode.com/svn/samples/tutorial/tags/api-0.6/json.js"></script>
    <script src="http://opensocial-resources.googlecode.com/svn/samples/tutorial/tags/api-0.6/SocialNorms.js"></script>
    <style>
    @import url(http://opensocial-resources.googlecode.com/svn/samples/tutorial/tags/api-0.6/styles.css);
    </style>
    <div id='main'>
    </div>
    <script>
    var gadgetToLoad = "activities";
    </script>
    <script src="http://opensocial-resources.googlecode.com/svn/samples/tutorial/tags/api-0.6/common.js"></script>

     the error is from the SocialNorms.js line 46

    /**
    * Create a social app on page load.
    * Stores the application in the window variable "theApp".
    *
    * @param {Object} appImpl. See createSocialApp
    * @param {String} type See createSocialApp
    * @param {String|Array&ltString&gt} key See createSocialApp
    */
    SocialNorms.createSocialAppOnLoad = function(appImpl, type, keys) {
    window['_IG_RegisterOnloadHandler'](function(){
    var app = SocialNorms.createSocialApp(appImpl, type, keys);
    window['theApp'] = app;
    app.start();
    });
    };

     can anyone give me information about this? am I doing it wrong or something?? thanks~

     

     

  • 02-14-2008 11:06 AM In reply to

    Re: Google Gadgets?

    Do you have the error message produced?  You've given us the line of code effected - thanks - but I couldn't see in your message the error message that was produced.

     

    Thanks,

    Ben 

  • 02-14-2008 11:46 PM In reply to

    Re: Google Gadgets?

    taken from firebug

     

    window._IG_RegisterOnloadHandler is not a function
        createSocialAppOnLoad(Object, "VIEWER", ["gifts"]) {SocialNorms.js (line 46)}
        myInit() {common.js (line 37)}
    window['_IG_RegisterOnloadHandler'](function(){

  • 02-15-2008 2:52 PM In reply to

    Re: Google Gadgets?

    I would consider that a bug in SocialNorms.js.  _IG_RegisterOnloadHandler is part of the closed Google Gadgets spec which was moved into the gadgets namespace (lower case g, an open spec), under gadgets.util.registerOnloadHandler, for 0.7.

    SocialNorms should do something like:

    var igOnload = window["_IG_RegisterOnloadHandler"];
    if (igOnload) {
      // do something with it
    }

    Which is actually from the 0.6 opensocial reference, and would be the correct way to do it.

    Chad 

Page 1 of 1 (4 items)