Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Dec 2013
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    load url in new (just opened) window currently showing another url

    I open a new window as follows.

    <code>

    var x = window.open(lnk,'doCAWin','fullscreen=yes,toolbar=no,location=no,directories=no,status=yes,menubar=n o,scrollbars=yes,copyhistory=no,resizable=yes,left=0,top=0,screenX=0,screenY=0', true);

    </code>

    I then try to open a new URL in that same new window. I want it to be in history. I've tried the 2 approaches below with no luck.

    <code>

    // 1st approach opens new window if _self is a name with last parm = true
    // should I be opening into the window named doCAWin

    var x = window.open(lnk,'_self','fullscreen=yes,toolbar=no,location=no,directories=no,status=yes,menubar=no, scrollbars=yes,copyhistory=no,resizable=yes,left=0,top=0,screenX=0,screenY=0', true); // tried with last parm (replace) as true and false

    window.location.href = lnk; // This does not do anything.

    </code>

    Any suggestions will be appreciated.

    ct

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,992
    Thanks
    203
    Thanked 2,536 Times in 2,514 Posts
    Why do you want to do that?

    Which of the three places (new window, new tab, same tab) web pages open is completely under the browser's owner's control. You can only suggest where it should open in your code and the browser can be set to ignore your suggestion and open it where the browser owner wants it to open.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    New to the CF scene
    Join Date
    Dec 2013
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm an application developer using the XHTML suite and my own DB stuff. When I enter the part of my application where content is entered, I want to open a new window without the back/forward buttons in a 1st screen. I provide a back button. A 2nd GUI invoked from the first also comes up in a new window currently, without the back/forward buttons. It has submit and cancel buttons to save and return to the 1st GUI or just return.

    The absence of the back button in this 2nd screen discourages the reflex of using the back button which would leave the record lock in place. The user can still close this window. The absence of the forward button in the 1st GUI prevents them from going back into that 2nd GUI they've just returned from without entering a password. And the user can still close this window.

    I have the above working well. I just thought bringing the 2nd GUI up in the 1st new window would be a little simpler. The 2 screens close themselves as they should as currently configured.

    I've been able to open the 2nd GUI in the 1st new window with the 1st window open approach above, but the history entry isn't right.

    Thanks for responding.

  • #4
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,639
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Your second window has the name 'doCAWin' so as long as the opener window is still displaying the page that opened that window that page can update the url displayed in the other window by referencing

    doCAWin.location.href = lnk;
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

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