refresh problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Clive Moore

    refresh problem

    I have an webpage that opens a child window that displays an applet.
    When the user calls this function for the second time the same window is
    opened which is fine except I need the page to be refreshed other wise
    the applet is not updated. Is this possible.

    This needs to be called after the window.open in the parent.

    Thanks
    Clive


    --
    Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
  • Erwin Moller

    #2
    Re: refresh problem

    Clive Moore wrote:
    [color=blue]
    > I have an webpage that opens a child window that displays an applet.
    > When the user calls this function for the second time the same window is
    > opened which is fine except I need the page to be refreshed other wise
    > the applet is not updated. Is this possible.
    >
    > This needs to be called after the window.open in the parent.
    >
    > Thanks
    > Clive
    >
    >[/color]

    Hi Clive,

    use this:

    var myAppletWindow = window.open(etc .etc

    // to reload:
    myAppletWindow. location.reload ();

    // to put something else in there:
    myAppletWindow. location.replac e("put url here");


    good luck,

    Regards,
    Erwin Moller

    Comment

    • Clive Moore

      #3
      Re: refresh problem

      Hi Erwin,

      This is my Code.

      var resultsWindow = window.open('re sultsViewer.jsp ', 'Results',
      'location=no, directories=no, status=no, menubar=no, scrollbars=yes,
      resizable=yes, copyhistory=yes , width=780, height=550');
      resultsWindow.l ocation.reload( );


      my problem is that i get a javascript error when the user opens the
      child
      window the first time. I think its due to the fact that
      im doing a reload on a window that is only opening.

      Any ideas
      Clive


      --
      Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

      Comment

      • Erwin Moller

        #4
        Re: refresh problem

        Clive Moore wrote:
        [color=blue]
        > Hi Erwin,
        >
        > This is my Code.
        >
        > var resultsWindow = window.open('re sultsViewer.jsp ', 'Results',
        > 'location=no, directories=no, status=no, menubar=no, scrollbars=yes,
        > resizable=yes, copyhistory=yes , width=780, height=550');
        > resultsWindow.l ocation.reload( );
        >
        >
        > my problem is that i get a javascript error when the user opens the
        > child
        > window the first time. I think its due to the fact that
        > im doing a reload on a window that is only opening.
        >
        > Any ideas
        > Clive
        >
        >[/color]

        Hi Clive,

        If you think the problem has to do with the fact the window is not loaded
        (very possible) try this maybe:

        var resultsWindow;

        function openResultWindo w(){
        // can open or re-load.
        if (resultsWindow) {
        resultsWindow.l ocation.reload( );
        } else {
        resultsWindow = window.open('re sultsViewer.jsp ', 'Results',
        'location=no, directories=no, status=no, menubar=no, scrollbars=yes,
        resizable=yes, copyhistory=yes , width=780, height=550');
        resultsWindow.l ocation.reload( );
        }

        In that way you test if it is open already and do the right thing depending
        on the existance of resultsWindow.

        I didn't check this code, so maybe it has some typo.

        Good luck,
        Erwin Moller

        Comment

        • Erwin Moller

          #5
          Re: refresh problem

          Sorry typo:

          var resultsWindow;

          function openResultWindo w(){
          // can open or re-load.
          if (resultsWindow) {
          resultsWindow.l ocation.reload( );
          } else {
          resultsWindow = window.open('re sultsViewer.jsp ', 'Results',
          'location=no, directories=no, status=no, menubar=no, scrollbars=yes,
          resizable=yes, copyhistory=yes , width=780, height=550');
          }

          That is without the resultsWindow.l ocation.reload( ); in the else-block. :-)

          Comment

          Working...