Home  >  Q&A  >  body text

javascript - When the front-end frame is reloaded, why does it keep reporting that there is no location method?

1, my page structure is like this:

    <frameset rows="72,*,16" border="1" framespacing="0" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
    <frame name="framHeader" src="top.aspx" scrolling="no" border="0" frameborder="no" noresize topmargin="0" leftmargin="0" marginheight="0" marginwidth="0"></frame>
    <frameset name="framMain" cols="250,*" border="0" frameborder="0" framespacing="1" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
        <frame name="framLeft" src="Left.html" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" frameborder="0" scrolling="no" noresize></frame>
        <frame name="framRight" src="right.html" frameborder="0" bordercolor="#e4e4e4" noresize></frame>
    </frameset>
    <frame name="framFooter" src="foot.html" marginwidth="0" marginheight="0" frameborder="no" scrolling="no" noresize>
</frameset>
    <noframes></noframes>

2. After logging in, framRight jumps to welcome.aspx. Now I want to refresh top.aspx in welcome.aspx so that the login name can be displayed in top.aspx.
But it doesn’t work no matter how I do it, please help me. .
My writing method:
After logging in, in welcome.aspx:

<p>
    <script>
        document.getElementsByName("framHeader").window.location.reload();
    </script>
</p>

I’ve tried all the methods you mentioned below, but they don’t work. . . . .


某草草某草草2686 days ago977

reply all(6)I'll reply

  • 为情所困

    为情所困2017-07-05 11:06:26

    The problem is finally solved:

    <script>

    window.parent.parent.frames["framHeader"].window.location.reload();

    </script>
    The method you provided above is based on the fact that the current page and the page to be refreshed are in the same frameset, and my page is not in the current frameset, so it cannot be refreshed across domains. You must find the frameset where the target page is located. .

    reply
    0
  • 大家讲道理

    大家讲道理2017-07-05 11:06:26

    document.getElementsByName("framHeader")[0].window.location.reload();

    reply
    0
  • 为情所困

    为情所困2017-07-05 11:06:26

    getElementsByName Students, please read the method name carefully

    reply
    0
  • 为情所困

    为情所困2017-07-05 11:06:26

    document.getElementsByName("framHeader") gets an array

    reply
    0
  • 女神的闺蜜爱上我

    女神的闺蜜爱上我2017-07-05 11:06:26

    You can try this statementdocument.getElementsByTagName('framHeader')[0].contentWindow.location.reload();

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-07-05 11:06:26

    I asked you to use so much jquery, getElementsByName returns an array

    reply
    0
  • Cancelreply