javascript - When the front-end frame is reloaded, why does it keep reporting that there is no location method?
某草草
某草草 2017-07-05 11:04:26
0
6
1028

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. . . . .


某草草
某草草

reply all(6)
为情所困

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. .

大家讲道理

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

为情所困

getElementsByName Students, please read the method name carefully

为情所困

document.getElementsByName("framHeader") gets an array

女神的闺蜜爱上我

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

phpcn_u1582

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template