views:

166

answers:

1

Hey guys

I'm using Jquery flowplayer tools overlay to open external links. External links are working fine with this piece of code shown in the link:

http://www.demiseonline.com/misc/Iframeoverlay.html

Now using this overlay - I wanted to open the twitter dialog which asks users to Allow access to their account.

So in the code below, I replaced http://www.google.com with https://twitter.com/oauth/authenticate?oauth_token=VPVRIsnRz9IX4CAab7brert3jHiEs

<div class="apple_overlay black" id="Overlay1"> 
   <iframe src ="http://www.google.com" width="100%" height="595px" frameborder="0"> 
   </iframe>
</div>

When I replace the code, as soon as I load the page, even before I click on the link to open the overlay - the page gets redirected to the twitter URL.

Any idea why that happens for this URL. Thanks

A: 

Their page is probably checking if it's in an iframe with something like

var isInIFrame = (window.location != window.parent.location) ? true : false;

-edit

Take a deeper look into the twitter API to connect to their services (https://apiwiki.twitter.com/OAuth-Examples) - You're going to need to be a go between, authenticating the user yourself and sending/retrieving data between the user and twitter.

See also: http://github.com/jmathai/twitter-async

Dan Heberden
I'm not sure - Basically I want to open the twitter page as an overlay. I used this example - http://flowplayer.org/tools/demos/overlay/external.htm - but it only opens relative pages like /ok.htm and not www.example.com/ok.htm - so I read on the internet to use IFrame to fix that but that seems to have its own issues.
Gublooo
Yes, those pages use relative pages that _aren't_ full html - they are only the html that will be "plugged in" the div that is overlayed via the tool you linked it. There are other tools to overlay an iFrame (such as thickbox::http://jquery.com/demo/thickbox/). -- The issue for you is you can't simple attach to the login page of twitter and have it load; think of the security risks if they allowed that. Some spam email says "log into twitter" with an iframe to twitter that they attach handlers to to retrieve the data? Twitter _has_ to make sure it's not in an iFrame.
Dan Heberden