Ning Developer Network

Brian

IFrame for content that is on my network, but not created by Ning.

I initially posted this on Network Creators. Alas, that is no more.

---------

I get the whole iframe breakout thing for Ning pages, and I see the JavaScript that does it. However, I created my own poll widget with no source code access, and it sits in a folder outside of the Ning widget structure, yet the page requests are still being intercepted and that JavaScript is being appended. The page refreshes over and over trying to break out, but when it comes back to the page, the iframe is there and it tries to break out again. Why is that, and how do I prevent this from happening on PHP pages I created? I need to load my poll widget with an iframe, and hosting it externally at the moment is not an option.

Tags: iframe, php

Share

Replies to This Discussion

Hi Brian,

The whole reason behind the JS breakout is because if a Ning page is served within an iframe tag, many of the dynamic JS won't work inside the framed element. That was a dojo thing; I'll do some research to see if it's still relevant now that we moved to jquery on Monday.

That said, I'm not aware at the top of my head on an easy way to bypass the code, unless your PHP widget is truly isolated (meaning, it doesn't run the standard Ning header or footer, which is where the break-out code is.) I'll have to ask around for that.

On a completely different note, you could always use a 3rd party polling tool and embed any exported widgets or badges into your site that way.

Thanks,
Ernie
Hi Ernie,

Thanks for taking the time to look into this. The poll I am using is not technically a Ning page. I don't pull in the header or footer, and I'm not actually using any Ning code (controllers, models, etc.). If I hit a PHP script directly that has an HTML header, the request is intercepted, and that is when the source is appended with the script that breaks it out of the frame. I'm assuming this is a security precaution, but if there is a workaround that would be very useful. Thanks again!

RSS

© 2009   Created by Ning Developer Admin

Badges  |  Report an Issue  |  Privacy  |  Terms of Service