Question : Bookmarklet + iFrame + Twitter Sign-In

Hi,

I'm creating a bookmarklet for a web project we're working on, the bookmarklet loads an iframe with a sign-in page offering twitter sign-in, everything is working as expected so far, however i'm facing problems in the case when the user isn't already signed in with twitter, he'll be then redirected to twitter sign-in page which is the expected behavior, however for some reason the twitter sign-in page is not loading inside the iFrame and replaces the parent document itself, this is the bookmarklet link for reference:

1:
2:
javascript:s=document.createElement('script');s.src='http://new.yumm.com/js/bookmarklet.js';s.type='text/javascript';void(document.getElementsByTagName('head')[0].appendChild(s));


Thanks In Advance.

Answer : Bookmarklet + iFrame + Twitter Sign-In

BTW, the break out javascript code is simple --

<script type="text/javascript">
      <!--
            if (top.location!= self.location) {
                  top.location = self.location.href
            }
      //-->
</script>

However, that is not the only way to do it.  I suspect twitter has their own method of doing this.
Random Solutions  
 
programming4us programming4us