#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Grantham,Lincs, UK
    Posts
    7
    Rep Power
    0
    Hi All,

    I am looking for a soloution for my reloading problem. If anyone can help please read on.

    I open a window by calling this:

    function popupMainWindow(fileName)
    {
    //windowVar = window.open("URL", "windowName" [,"windowFeatures"])
    window.open(fileName, "Diary", "width=750, height=550, status=no, toolbar=no, menubar=no, location=no, scrollbars=yes");
    }


    On the page it loads there is a link which loads another window like so:

    function popupEventWindow(fileName)
    {
    window.open(fileName, 'Event', "width=450, height=400, status=no, toolbar=no, menubar=no, location=no, scrollbars=yes");
    }


    All the above works fine. While I am in the second window I submit some data to itself and then if its sucessful I pop up a message and close the window.

    I want to then reload the first window (Diary).

    My Javascript at the top of the second window which is called on sucess of the submission is:

    function eventsaved()
    {
    alert ('Your Event Has Been Saved');
    }
    function closeWindow()
    {
    window.close();
    }

    The above works fine. I then added a call to this reload function, it should reload the other window, but it does not:

    function reloadOffice()
    {
    office.location.reload(true);
    }


    If anyone can help it would be greatly appreiciated.

    Duncan Beddows
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    81
    Rep Power
    15
    I'm not certain where your function:

    function reloadOffice()
    {
    office.location.reload(true);
    }


    is located. If it is in the second pop-up, then you must give it time to run prior to closing the second pop-up. Perhaps some sort of timer before you close the popup.

    I also assume 'office' is the window name of the popup that you have titled 'Diary'? Is this true? I ask because I don't see anyplace in your script where you define the name of the popup window titled 'Diary'. (I assume you know window name and window title are two different things.) The function should work as long as the window still exists. So from what you have stated, the only thing I can come up with is you have not properly named the popup window.

    Does this help?

    Let me know.

    Russ


    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by djbeddows:
    Hi All,

    I am looking for a soloution for my reloading problem. If anyone can help please read on.

    I open a window by calling this:

    function popupMainWindow(fileName)
    {
    //windowVar = window.open("URL", "windowName" [,"windowFeatures"])
    window.open(fileName, "Diary", "width=750, height=550, status=no, toolbar=no, menubar=no, location=no, scrollbars=yes");
    }


    On the page it loads there is a link which loads another window like so:

    function popupEventWindow(fileName)
    {
    window.open(fileName, 'Event', "width=450, height=400, status=no, toolbar=no, menubar=no, location=no, scrollbars=yes");
    }


    All the above works fine. While I am in the second window I submit some data to itself and then if its sucessful I pop up a message and close the window.

    I want to then reload the first window (Diary).

    My Javascript at the top of the second window which is called on sucess of the submission is:

    function eventsaved()
    {
    alert ('Your Event Has Been Saved');
    }
    function closeWindow()
    {
    window.close();
    }

    The above works fine. I then added a call to this reload function, it should reload the other window, but it does not:

    function reloadOffice()
    {
    office.location.reload(true);
    }


    If anyone can help it would be greatly appreiciated.

    Duncan Beddows
    [/quote]

  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Grantham,Lincs, UK
    Posts
    7
    Rep Power
    0
    I must admit I don't know the difference between name and title unless you are refering to <title> I do. All I did to name the window was give it a name on opening it.

    function popupMainWindow(fileName)
    {
    window.open(fileName, "office", "width=750, height=550, status=no, toolbar=no, menubar=no, location=no, scrollbars=yes");
    }

    Is this all I need to do to name the windows? when opening multiple popups do they all know of the existance of the other windows?? Or is the message to reload a window just sent to you computer?

    Many Thanks
    Duncan
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    81
    Rep Power
    15
    Take the expression:

    win1=window.open('myfile.htm','mytitle',details)

    This line of code opens a window with a name of win1 and a title (in the title bar) of mytitle. You cannot refer to the window by the title.

    Change your code to:

    function popupMainWindow(fileName)
    {myname = window.open(fileName, "office", "width=750, height=550, status=no, toolbar=no, menubar=no, location=no, scrollbars=yes");
    }

    Now you can refer to this popup by the name 'myname'. For example, if you want to check to see if the window is open, and if it isn't, open it, if it is, give it focus, you could write the expression:

    <a href="#" onclick="javascript win1)?(win1.focus()) win1 = window.open(....));">CLICKME</a>

    The above could be placed within any appropriate HTML tag. To place it withing a script:

    if(win1)
    {win1.focus();}
    else
    {win1 = window.open(...);}

    Hope this helps

    Russ

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by djbeddows:
    I must admit I don't know the difference between name and title unless you are refering to <title> I do. All I did to name the window was give it a name on opening it.

    function popupMainWindow(fileName)
    {
    window.open(fileName, "office", "width=750, height=550, status=no, toolbar=no, menubar=no, location=no, scrollbars=yes");
    }

    Is this all I need to do to name the windows? when opening multiple popups do they all know of the existance of the other windows?? Or is the message to reload a window just sent to you computer?

    Many Thanks
    Duncan
    [/quote]

  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    81
    Rep Power
    15
    Damn smiley faces!

    The little blue 'sad' faces are actually colons (.

    Russ
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 1999
    Posts
    84
    Rep Power
    15
    Actually thats completely backwards.

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>
    Take the expression:

    win1=window.open('myfile.htm','mytitle',details)

    This line of code opens a window with a name of win1 and a title (in the title bar) of mytitle. You cannot
    refer to the window by the title.
    [/quote]

    In this statement:

    win1=window.open('myfile.htm','mytitle',details)

    "myTitle" is the name of the window that is created. This is how you would access that window from other windows. "win1" is just a variable that the statement is assigned to. You can access the window using this variable within the script. To access that window from other windows you would use the name.

    Spookster

    ------------------
    Visit the WSAbstract Help Forum for your Javascript, DHTML, or General Web Design Questions

Similar Threads

  1. .NET vs. Windows API programming
    By anatol in forum .Net Development
    Replies: 5
    Last Post: January 23rd, 2004, 10:23 AM
  2. Matrix Reseller - Windows 2003 and FreeBSD $35 ColdFusion MX
    By vortech in forum Web Hosting Offers
    Replies: 0
    Last Post: October 14th, 2003, 07:07 PM
  3. Jobs: System Software Dev
    By sridharr in forum Hire A Programmer
    Replies: 0
    Last Post: August 1st, 2003, 03:12 AM
  4. Need Help Networking A Desktop and Labtop
    By grkgqmodel in forum Networking Help
    Replies: 1
    Last Post: June 20th, 2003, 02:55 PM
  5. generating reloading of another windows
    By Pupeno in forum HTML Programming
    Replies: 2
    Last Post: December 18th, 2001, 11:42 AM

IMN logo majestic logo threadwatch logo seochat tools logo