2 messages in com.googlegroups.opensocial-orkut[orkut-developer] Re: Getting permiss...
FromSent OnAttachments
krishna chaitanya23 Jun 2008 06:24 
Jason24 Jun 2008 11:34 
Subject:[orkut-developer] Re: Getting permission denied error
From:Jason (apij@google.com)
Date:06/24/2008 11:34:55 AM
List:com.googlegroups.opensocial-orkut

It sounds like you're running into a cross-domain issue. Because the page loaded in your IFrame is hosted on a different domain than the containing page, the browser won't let you call certain methods or set certain properties on the containing window -- you'll get a "Permission denied" error instead.

In general, building a client-side OpenSocial application in this way is a losing strategy -- even if you can get owner and friend information into the IFrame at load time, your application won't be able to post activities in response to a user action or otherwise interface with the OpenSocial API, defeating the purpose of building a social application in the first place. I suggest waiting for the REST- based API (which is coming with support for OpenSocial 0.8) or implementing your server-side business logic in JavaScript (e.g. random friend selection) -- your server can still come in handy if you need to store information in or retrieve information from your database, which you can do a call to the client-side gadgets.io.makeRequest method.

Let me know if you have any other questions.

On Jun 23, 6:24 am, krishna chaitanya <kris@gmail.com> wrote:

Hi

Issue: ==== Not able to execute a javascript method from serverside code.

window.parent.executeMethod()

or

top.executeMethod()

in the server side code is returning permission denied error. (Was able to find the error message using firefox webdevloper extension. Otherwise page displayes blank html)

Requirement ========== In  orkut application I can fetch all the friends of the owner. Now my server will randomly decide a friend.  I want to display that random friend image in the page.

[Please refer tohttp://developer.apple.com/internet/webcontent/iframe.html for remote scripting strategy.]

I am calling the serverside php in an iframe. So I won't have access to the iframe innerHTML.

This is why I am trying to call a method in client javascript code from the server side. This is giving permission denied error.

Any workarounds for this issue.