Refreshing the parent page from the SECOND child

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

    Refreshing the parent page from the SECOND child

    Hello,

    I posted this on two forums, without too much help .. and I am kinda
    stuck in this.
    I need to refresh the parent page from the second child window which
    is opened by the first child and the first child window closes after
    opening the second child.

    This is the second time I am typing the post, I lost all content
    because the site complaine I was using the lesser than symbol.

    Here is the code I wrote for this. the first child doesnt open the
    second child in IE. however, in firefox, the first child does open the
    second one but closes without even me writing code to close. Ofcourse,
    it doesnt call the script on the parent page.

    Parent :
    --------------------------------------------------------------------------------

    <a href="javascrip t:void(0);"NAME ="My Window Name" title=" My title
    here
    "onKlick=window .open("child.ht ml","Ratting"," width=550,heigh t=170,0,status= 0,");>
    Click here to open the child window</a>

    --------------------------------------------------------------------------------


    child :

    --------------------------------------------------------------------------------

    <script language="JavaS cript">function goback()
    {window.opener. location.reload ("google.com"); window.close(); }</script>
    and then called the function with a button open another window<a
    href="javascrip t:void(0);"NAME ="My Window Name1" title=" My title
    here11
    "onKlick=window .open("child2.h tml","Ratting", "width=150,heig ht=120,0,status =1");>Click
    here to open the child window</a <input type="button" value="Close
    this window" Onklick="goback ()">

    --------------------------------------------------------------------------------


    child1 (this is saved as child2.html on my system):

    --------------------------------------------------------------------------------

    <script language="JavaS cript">function goback()
    {window.opener. location.reload ("google.com"); window.close(); }</script>
    and then called the function with a button on parent <input
    type="button" value="Close this window" OnKlick="goback ()">

    --------------------------------------------------------------------------------


    ofcourse the onklick is typo'd. Any help, appreciated
  • GArlington

    #2
    Re: Refreshing the parent page from the SECOND child

    On Jul 31, 6:17 am, Buddha <happybudd...@g mail.comwrote:
    Hello,
    >
    I posted this on two forums, without too much help .. and I am kinda
    stuck in this.
    I need to refresh the parent page from the second child window which
    is opened by the first child and the first child window closes after
    opening the second child.
    >
    This is the second time I am typing the post, I lost all content
    because the site complaine I was using the lesser than symbol.
    >
    Here is the code I wrote for this. the first child doesnt open the
    second child in IE. however, in firefox, the first child does open the
    second one but closes without even me writing code to close. Ofcourse,
    it doesnt call the script on the parent page.
    >
    Parent :
    --------------------------------------------------------------------------------
    >
    <a href="javascrip t:void(0);"NAME ="My Window Name" title=" My title
    here
    "onKlick=window .open("child.ht ml","Ratting"," width=550,heigh t=170,0,status= 0,");>
    Click here to open the child window</a>
    >
    --------------------------------------------------------------------------------
    >
    child :
    >
    --------------------------------------------------------------------------------
    >
    <script language="JavaS cript">function goback()
    {window.opener. location.reload ("google.com"); window.close(); }</script>
    and then called the function with a button open another window<a
    href="javascrip t:void(0);"NAME ="My Window Name1" title=" My title
    here11
    "onKlick=window .open("child2.h tml","Ratting", "width=150,heig ht=120,0,status =1");>Click
    here to open the child window</a <input type="button" value="Close
    this window" Onklick="goback ()">
    >
    --------------------------------------------------------------------------------
    >
    child1 (this is saved as child2.html on my system):
    >
    --------------------------------------------------------------------------------
    >
    <script language="JavaS cript">function goback()
    {window.opener. location.reload ("google.com"); window.close(); }</script>
    and then called the function with a button on parent <input
    type="button" value="Close this window" OnKlick="goback ()">
    >
    --------------------------------------------------------------------------------
    >
    ofcourse the onklick is typo'd. Any help, appreciated
    If you have [as I understand it) any number of intermediate windows
    and you want to close the main parent window from any of the [great-
    grand-]children all you have to do is to pass a window name to the new
    window that you are opening...
    Then in you child you access the main window by name
    mainParentWindo w = window.open("", mainParentWindo wName);
    mainParentWindo w.location="... ";

    Comment

    • Henry

      #3
      Re: Refreshing the parent page from the SECOND child

      On Jul 31, 2:23 pm, GArlington wrote:
      On Jul 31, 6:17 am, Buddha wrote:
      <snip>
      > <a href="javascrip t:void(0);
      Navigating to a javascript pseudo-protocol HREF does strange things in
      Widows IE at least up until version 6. These include (but are not
      limited to) stopping the playing of GIF animation, stopping changing
      the displayed image when assigning to the - src - properties of IMG
      elements and stopping acting on META REFRESH elements. Pretty much, if
      javascript pseudo-protocol HREFs are activated on these browsers
      nothing is guaranteed to work from that point on.

      <snip>
      >"width=550,hei ght=170,0,statu s=­0,");>
      ^^^
      There is nothing in the specified form for the third argument to the -
      window.open - method that suggests that '0' would be a meaningful
      value, and if the browser does not ignore it then it is likely to
      cause problems.

      <snip>
      >ofcourse the onklick is typo'd.
      Why?
      Any help, appreciated
      >
      If you have [as I understand it) any number of intermediate
      windows and you want to close the main parent window from
      any of the [great- grand-]children all you have to do is
      to pass a window name to the new window that you are opening...
      With the exception of tacking the name onto a query string in the URL
      for the new window, anywhere you can pass a name you can also pass an
      object reference. Thus it might be better to pass the reference
      instead as the use of that might avoid the possibility of the -
      window.open - call re-opening a main window that had already been
      closed by the user.
      Then in you child you access the main window by name
      mainParentWindo w = window.open("", mainParentWindo wName);
      mainParentWindo w.location="... ";
      Why not use whichever URL is assigned to - location - as the first
      argument to - window.open - and not bother with the second javascript
      statement?

      Comment

      • SAM

        #4
        Re: Refreshing the parent page from the SECOND child

        Buddha a écrit :
        Hello,
        >
        I posted this on two forums, without too much help .. and I am kinda
        stuck in this.
        I need to refresh the parent page from the second child window which
        is opened by the first child and the first child window closes after
        opening the second child.
        in 2nd child (daughter which will close the mother) :

        var mamy = opener.opener; // the grand mother
        opener.close(); // kill 1st child (the mother)
        mamy.document.b ody.innerHTML = 'hello'; // gran'ma says 'hello'




        or if you prefer :

        - in 1st child (the mother) :

        daughter = window.open('2. htm','','width= 300');
        daughter.grd_mo ther = this.opener; // tell to daughter where is gran'ma
        self.close(); // mother's auto close

        - in 2nd child (the daughter) :

        grd_mother.docu ment.innerHTML = 'hello';


        --
        sm

        Comment

        • Thomas 'PointedEars' Lahn

          #5
          Re: Refreshing the parent page from the SECOND child

          Buddha wrote:
          I posted this on two forums, without too much help .. and I am kinda
          stuck in this.
          I need to refresh the parent page from the second child window which
          is opened by the first child and the first child window closes after
          opening the second child.
          [...]
          This is the second time I am typing the post, I lost all content
          because the site complaine I was using the lesser than symbol.
          Do not use Google Groups for posting.
          Here is the code I wrote for this. the first child doesnt open the
          second child in IE. however, in firefox, the first child does open the
          second one but closes without even me writing code to close. Ofcourse,
          it doesnt call the script on the parent page.
          >
          Parent :
          --------------------------------------------------------------------------------
          >
          <a href="javascrip t:void(0);"NAME ="My Window Name" title=" My title
          ^^
          here
          "onKlick=window .open("child.ht ml","Ratting"," width=550,heigh t=170,0,
          ^ ^ ^
          status=0,");>
          ^^^
          Click here to open the child window</a>
          Eeek.

          Make it Valid HTML first (yes, all of it; yes, you will have to learn
          HTML for that), then deal with possibly remaining scripting issues.

          <http://validator.w3.or g/>
          <http://diveintomark.or g/archives/2003/05/05/why_we_wont_hel p_you>


          PointedEars
          --
          realism: HTML 4.01 Strict
          evangelism: XHTML 1.0 Strict
          madness: XHTML 1.1 as application/xhtml+xml
          -- Bjoern Hoehrmann

          Comment

          Working...