Advanced Search

Results 1 to 3 of 3

Thread: Open page in same window, or close first window without alert

  1. #1
    Join Date
    Dec 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy All I wanted for christmas... :-/

    I posted this problem originally at december, 16th, but haven't received any answers. Is it really possible that there isn't any solution, or that nobody knows the solution?? Well, I try one more shot, pleaze post me an answer if you can help me!

    I use the following code to open a new page, or more precisely, a frameset of several pages, in full screen mode:

    <script>
    function fullwin(targeturl) {
    window.open(targeturl,"","fullscreen,scrollbars")
    }
    </script>

    <form>
    <input type="button" onClick="fullwin('mypage.html')" value="Show My Frameset">
    </form>

    (My last problem was related to the same script , I needed a code to make users able to close this fullscreen window.)

    Problem 1
    This script opens a new window when button is pushed. When the full screen window is closed down, this page with the button is still on the screen. I want the new page to load in the same window, that is, replacing the contents in the window, like target="_top"

    Q1: Can somebody out there see how I can modify or rewrite the code so that the new page loads in the same window?

    Problem 2
    I've modifed the latter part to the following:

    <form>
    <input type="button" onClick="window.close(); fullwin('mypage.html')" value="Show My Frameset">
    </form>

    The above code closes the initial window before the new pages were loaded into a new window in full screen mode, BUT, the browser is showing an alert; "The page you are viewing are trying to close the window. Are you sure you want to close the window (Yes/No)". (Or something like that :-/ )

    Q2: Do somebody out there know how to close the first window, whitout showing any alert? The first window should close while the new one was loading, whitout asking the user anything!

    If someone is able to help me with one of these questions, my problem is solved. I would appriciate it an be very greatful!!! If you know the answer of either Q1 or Q2, or both, please post me an answer! :-)
    Last edited by JS Novice; 12-28-2004 at 10:20 PM.

  2. #2
    Join Date
    Feb 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    To load a page in the same window, try using

    window.navigate("default.asp");

  3. #3
    Join Date
    Feb 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi JS Novice!!!

    Offcourse you can do this
    try this link
    http://vadivel.blogspot.com/2004/02/...nt-window.html

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
  •