I'm writing an app whose canvas page gets quite long. I have a link which does a jQuery smoothscroll to the top which worked fine on my development server.

 

However, Ning's gadget container is from the domain, *.ninggadgets.com, while the network is from *.ning.com or mycustomdomain.com.   This causes the JS which references the iframe's parent (window.parent) to cause a cross-domain security error.

 

Is there anyway to wrap the gadget container so that it comes from the same domain as the surrounding page?  Or is there another way to bypass this security restriction?

 

thx!

HKS

Views: 323

Reply to This

Replies to This Discussion

To get around the cross domain issues with OpenSocial, you can use the gadgets.io.makeRequest function. Checkout the Accessing External Resources page.

Thanks Devin.  Yeah data requests are fine with makeRequest, but there are more issues with cross domain...

 

For example reading the query string of page's url via window.parent.location.search causes an access error, thus preventing having more than one url-based startup states for the application.

 

Also, I've noticed that the OS native method, gadget.window.adjustHeight(), also throws JS errors due to cross domain security...


Devin said:

To get around the cross domain issues with OpenSocial, you can use the gadgets.io.makeRequest function. Checkout the Accessing External Resources page.

I had this issue, there was some typo

gadgets.window.adjustHeight()

was missing a s after gadget

Reply to Discussion

RSS

Blog Posts

Getting Started

Posted by Kyle Ford on October 13, 2010 at 8:00am 3 Comments

A Note on API Pricing

Posted by Phil McCluskey on October 1, 2010 at 8:55am 0 Comments

Welcome to Build!

Posted by Kyle Ford on September 30, 2010 at 8:30pm 1 Comment

Ning Status

© 2024   Created by Build Team.   Powered by

Badges  |  Report an Issue  |  Terms of Service