gevensen Posted July 20, 2009 Share Posted July 20, 2009 Hopefully a simple question How can I take a page that has frames and collapse or close them without clsoing the browser window IOW I am using a frame i have an expense image on the left and a voucher on the right when the voucher saves successfully it redirects to the index but the frame for the image is still open for example: <FRAMESET COLS="800,*" FRAMEBORDER=0 FRAMESPACING=0 BORDER=0> <?php //echo "trying to call ".$expenseimage1."<br />";?> <!-- left frame which is the image frame--> <FRAME SRC="expense_image1.php" NAME=ExpenseImage> <!-- right frame is another frameset --> <!-- rows for horizontal divisions --> <FRAMESET ROWS="1200,*"> <!-- top frame --> <!-- <FRAME SRC="titlebar.html" NAME=titlebar SCROLLING=NO> --> <?php echo "trying to call ".$expenseimage2."<br />";?> <!-- bottom frame --> <FRAME SRC="expense_image_2.php" NAME=Expense> </FRAMESET> Quote Link to comment Share on other sites More sharing options...
rhodesa Posted July 20, 2009 Share Posted July 20, 2009 how are you redirecting? if it's an A tag, it should just be: <a href="index.html" target="_top">Click Me</a> edit: another suggestion...don't use frames Quote Link to comment Share on other sites More sharing options...
gevensen Posted July 20, 2009 Author Share Posted July 20, 2009 php is calling it i am not clicking on it manually so i didnt use href Quote Link to comment Share on other sites More sharing options...
rhodesa Posted July 20, 2009 Share Posted July 20, 2009 how is PHP calling it? with a header('Location: ...') redirect? Quote Link to comment Share on other sites More sharing options...
gevensen Posted July 20, 2009 Author Share Posted July 20, 2009 i found an answer on the page its going to insert this java code after the body starts and it breaks the frames! <script> if (window!= top) top.location.href=location.href </script> Quote Link to comment Share on other sites More sharing options...
gevensen Posted July 20, 2009 Author Share Posted July 20, 2009 how is PHP calling it? with a header('Location: ...') redirect? let me rephrase the previous page calls a header redirect then the filenames are in <FRAME SRC="expense_image_2.php" NAME=Expense> and <FRAME SRC="expense_image_1.php" NAME=Image> this calls the 2 files into the frames (of course the code is not next to each other see the 1st post for the location any other data is passed via session to the 2 pages called where it loads the info in seperate frames Quote Link to comment Share on other sites More sharing options...
haku Posted July 21, 2009 Share Posted July 21, 2009 i found an answer on the page its going to insert this java code after the body starts and it breaks the frames! <script> if (window!= top) top.location.href=location.href </script> That's not java. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.