Tushar, I have already answered your question in another thread.
Thanks, Rohan Dighe Creator - Housie http://www.orkut.com/Main#AppInfo.aspx?appId=238484389258 Tushar wrote: > Hi, > I am new for devloping an orkut application. > I am trying to create a link in the page. > For that I have added following code. > But somehow the link does not work. Whenever I click onto the link it > renders the same page again. > Can anyone please help me out to solve this problem? > > My code is like this :- > > 1) main.xml > <?xml version="1.0" encoding="UTF-8"?> > <Module> > <ModulePrefs title="Test Application Demo"> > <Require feature="opensocial-0.7"/> > <Require feature="views"/> > </ModulePrefs> > <Content type="html"> > <![CDATA[ > <div id="link"></div> > <script> > var userID; > function request() { > var params = {}; > params > [opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] = > [opensocial.Person.Field.PROFILE_URL]; > > var req = opensocial.newDataRequest(); > req.add(req.newFetchPersonRequest > (opensocial.IdSpec.PersonId.VIEWER, params), "viewer"); > req.send(response); > }; > > function makeLink(page, app_id, uid) { > return [ gadgets.util.getUrlParameters()["parent"], > "/Application.aspx?appId=", > app_id, > "&uid=", > uid, > "&appParams=%7B%22page%22%3A%22", > page, > "%22%7D" ].join(""); > }; > > function response(data) { > var viewer = data.get("viewer").getData(); > var profile_url = viewer.getField > (opensocial.Person.Field.PROFILE_URL); > var regex = /uid=([^&#]+)/; > var result = profile_url.match(regex); > if (result.length == 2) { > userID = result[1]; // uid now contains the viewer's > orkut UID > var application_id = > gadgets.util.getUrlParameters()["gadgetId"]; > // alert("application_id" + application_id); > > make_link=makeLink("helloworld",application_id,userID); > // alert(make_link); > document.getElementById("link").innerHTML="<a > href=" + make_link + > " > Hello </a>"; > } else { > /* there was a problem getting the UID */ > } > }; > request(); > > </Content> > </Module> > ========================================================= > 2) helloworld.xml > <?xml version="1.0" encoding="UTF-8" ?> > <Module> > <ModulePrefs title="Test"> > <Require feature="opensocial-0.7" /> > <Require feature="views"/> > </ModulePrefs> > <Content type="html"> > <![CDATA[ > Test Demo. > ]]> > </Content> > </Module> > > Any help appreciated. > > Thanks, > Tushar > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---