SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict scoobasteve1982's Avatar
    Join Date
    Apr 2007
    Posts
    333
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    AJAX problem. Execute function outside of IFRAME from within IFRAME

    Hi there and thanks for visiting my post,

    I'm working on an issue that I'm having here on an Intranet I'm working on here @ work. I'm using the Ext framework (extjs.com which is really rad btw) to create a paneled layout. Each panel is essentially an iframe that's styled up real nice. My problem is, is that I'm using a lot of AJAX. At the top of my AJAX scripts I have PHP security stuff that redirects the browser to the login page. However, it's redirecting in the IFRAME and not the entire browser when the AJAX response comes back. I understand that I'm within an IFRAME so this behavior is correct. However, if the user logs in through the IFRAME (which they will), then a whole new instance of the Intranet is in the IFRAME. I do not want this. What I'm hoping to achieve is trigger a function outside the IFRAME when the redirect occurs that will update the header.location and move them to the login page. I'm not really sure if this make sense or is even possible. If not, I just want to know if its possible to execute a function outside of an IFRAME via JavaScript. Or, if you happen to know PHP (the ss language I'm using) then perhaps their is a way that way. Any help would be greatly appreciated. Thanks!!

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How about on your "Access denied/please logon" page (which may or may not be loading in an iframe):
    Code:
    <script type="text/javascript">
    window.onload = function () {
      if (self !== top) {
        top.location.href="accessdenied.php";
      }
    }
    </script>
    There's nothing ajax'y about this code, if you are using ajax to get the html of the "Access denied" page and load it into the iframe, you'd need to put your check in the ajax handler.

  3. #3
    SitePoint Addict scoobasteve1982's Avatar
    Join Date
    Apr 2007
    Posts
    333
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you Jim I appreciate your response.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •