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 9 of 9
  1. #1
    mbl
    mbl is offline
    New Coder
    Join Date
    Sep 2004
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help window.open FireFox vs I.E. (easy one)

    Good friends,

    In the following code, a small text window opens when user clicks word BENEFITS. In Firefox, the child window opens on click just fine, and stays open so user can go back and do some adjustments that relate to the instructions in the child window (user needs to scroll up/down in parent window). In other words, the two windows are accessible independently. This is running on Windows XP machine.

    However, the same code opened with the I.E., the child window opens and it is the ONLY one that can be accessed. So the user can not be reading the child-window instructions and access the parent window to scroll it for more info. Thus, in I.E., the child window HAS to be closed, defeating the purpose of it being an instructions window.

    Here's the little code.
    -----------------------------------------------
    <HTML>
    <HEAD>
    <TITLE>Title of your page</TITLE>
    </HEAD>

    <BODY>

    <a href="javascript:void window.open
    ( 'camel_benefits.html',
    'MyWin','width=300,height=500,
    toolbar=0, top=150,
    left=600, menubar=0, status=1,
    scrollbars=0, resizable=1' )">
    BENEFITS
    </a>

    </BODY>
    </HTML>
    ------------------------------------

    Is this a known deal? If so, what'd be a simple change
    to achieve this simple thing and to behave as in I.E. the
    same way (as described above) in Firefox?

    Your kind help is appreciated.

    Thanks.

    -mbl-

  • #2
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    625
    Thanks
    0
    Thanked 0 Times in 0 Posts
    "God so loved the world that he gave his only begotten son, so that whosoever believed in him would not perish, but have everlasting life. For God did not send his son into the world to condemn the world, but so that through him the world might be saved. "

  • #3
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    can we see the page this is on?
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #4
    mbl
    mbl is offline
    New Coder
    Join Date
    Sep 2004
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by joh6nn
    can we see the page this is on?
    Yes. The page is: http://www.muga-zafu.com/camel.html

    Opening it with FireFox, scroll the text-bar to Fig.3, browse over its text so the Fig.3 photo shows.

    Then click BENEFITS which will open the child window (it's text). Move the child window anywhere to allow access to the parent window. Move the parent-window vertical-scroll bar so as to be able to see the photo complete. Then go back to the child-window 'BENEFITS' so both Parent and Child windows shows what needs to be seen. It works with the FireFox as shown.

    However, when the same page opened with the I.E., the adjustments for proper viewing as explained above are NOT possible because with the I.E. the controls of the Parent window can not be accessed, meaning that the child-window "BENEFITS" has to be closed, missing the point of the user to see both windows.

    Would say the difference seems to be important as far as browser-functioning, but would like to see if a simple fix is available. Am a beginner in this and would not like to re-do the page in any extenssive way.

    Thanks.

    -mbl-

  • #5
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    i'm pretty sure your problem is in camel_benefits.html, not in camel.html. you've got this in camel_benefits:

    Code:
    <body onblur="this.focus()"
    that tells the browser to bring the window back to the top, whenever it loses focus. try removing that bit of code, and see if it helps.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #6
    mbl
    mbl is offline
    New Coder
    Join Date
    Sep 2004
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by joh6nn
    i'm pretty sure your problem is in camel_benefits.html, not in camel.html. you've got this in camel_benefits:

    Code:
    <body onblur="this.focus()"
    that tells the browser to bring the window back to the top, whenever it loses focus. try removing that bit of code, and see if it helps.
    Yes, friend.

    That fixed it. Had put that code trying to keep the child window from getting lost behind the parent window and that did not work. Then changed the window to open much to the right with the LEFT parameter. Since in FireFox it made no difference, had overlooked to remove that onblur part.

    Your expertise and kindness match each other.

    Both appreciated.

    -mbl-

  • #7
    mbl
    mbl is offline
    New Coder
    Join Date
    Sep 2004
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts
    P.S.

    Joj6nn, friends,

    The correction is uploaded already. But do have this more to ask, if the answer is not too involved:

    When the child window is opened (BENEFITS) and the user accesses the parent window, the child window at times may be completely covered by the parent window.

    To most users, it may not be obvious that it is still behind the parent, though totally covered. So the user would again click on the word BENEFITS in the parent window and nothing happens. This would lead to confuse the user to think that something is not working.

    Is there a way that if in this situation, clicking again on BENEFITS would bring the child window again to the fore-ground?

    It's somewhat as if the word BENEFITS would first close the child window and then would open it again. In older programming languages, that's how it would be done.

    But there may be newer ways. If so and not too involved, would appreciate some guideance there.

    Thanks.

    -mbl-

  • #8
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeå, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Well, that should be simple. First, check if the BENEFITS window already exists. (do a simple type check) If it does and is not closed (read out the closed property), call focus on it. If it doesn't exist or is closed, open it.
    Code:
    function bringBenefitsToFocus(){
        if(typeof windowobject=='undefined'||windowobject.closed)
            windowobject=/* code to open the window here */;
        else
            windowobject.focus();
    }
    Last edited by liorean; 11-01-2004 at 05:02 AM.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #9
    mbl
    mbl is offline
    New Coder
    Join Date
    Sep 2004
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by liorean
    Well, that should be simple. First, check if the BENEFITS window already exists. (do a simple type check) If it does and is not closed (read out the closed property), call focus on it. If it doesn't exist or is closed, open it.
    Code:
    function bringBenefitsToFocus(){
        if(typeof windowobject=='undefined'||windowobject.closed)
            windowobject=/* code to open the window here */;
        else
            windowobject.focus();
    }

    Thank you Lorian,

    It looks just right. Will have to learn a bit about using function and will definitely try it.

    Would like to point out also that functioning like the above code provides perhaps ought to be an intrinsic part of the window.open method. Why so?

    Because window.open seems to do this:

    1. Chcks for window to exist. If NOT, creates one.
    2. Then opens it.
    3. Then fills it.
    4. THEN brings it to the foreground.

    However,
    1. Chcks for window to exist. If YES, DOES NOT create one.
    2. Then opens it.
    3. Then fills it (replacing existing data).
    4. Then DOES NOT bring it to the foreground.

    Would say that it does not make sense NOT TO bring it to the foreground only because of the criterium that it already exists.

    Perhaps the window.open method ought to have a parameter to that effect.

    Thanks a lot for the good help.

    -mbl-


  •  

    Posting Permissions

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