When i executed below code on profile page then it gives the 2 main
error

1.opensocial is not defined
2.gadgets is not defined:-
       when i call gadgets.util.registerOnLoadHandler(createLinks);
this function on profile page

please help as soon as and give me the example how can i solved this
problem and how can i get owner and viewer id get it on the profile
page ??



Example:-
-------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
  <ModulePrefs title="Navigating Between Views (0.7)"
description="Navigates between views">
    <Require feature="opensocial-0.7" />
 <Require feature="dynamic-height"/>
<Require feature="views"/>
 <Require feature="opensocial-data" />
  <Require feature="opensocial-templates">
  <Require feature="analytics"/>
    <Param name="process-on-server">true</Param>
  </Require>
</ModulePrefs>
  <Content type="html">
  <![CDATA[
  <html>
 <head>
    <script type="text/javascript">


/**
 * Create the list of links to the other views
 */
function createLinks() {
  //Get the environment, current view and an object containing the
supported views
  var env = opensocial.getEnvironment();
  var views = gadgets.views.getSupportedViews();
  var currentview = gadgets.views.getCurrentView();
  var text = [ "You are currently on the ",
               currentview.getName(),
               " view.  Other views: " ].join("");

  //Set up some DOM
  var outputdom = document.getElementById("main");
  outputdom.appendChild(document.createTextNode(text));
  var ol = document.createElement("ol");
  outputdom.appendChild(ol);

  //Iterate over each view
  for (var viewname in views) {
    var view = views[viewname];
    //Make some DOM to present each link
    var li = document.createElement("li");
    var a = document.createElement("a");
    ol.appendChild(li);
    li.appendChild(a);
    a.href = "javascript:void(0);";

    //Put the name of the surface in the link
    a.appendChild(document.createTextNode("Link to " + view.getName
()));
    //Handle when the user clicks a link to the other server
    a.onclick = getNavigateClosure(view);
  }
};

/**
 * Returns a function that navigates to the supplied view
 */
function getNavigateClosure(view) {
  return function() { gadgets.views.requestNavigateTo(view); };
};

//Execute createLinks when the page is done loading
gadgets.util.registerOnLoadHandler(createLinks);


    </script>
    </head>
    <body onload="createLinks();">
       <div id="main" ></div>
      </body>
     </html>
  ]]>
  </Content>
</Module>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Orkut Developer Forum" group.
To post to this group, send email to opensocial-orkut@googlegroups.com
To unsubscribe from this group, send email to 
opensocial-orkut+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/opensocial-orkut?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to