Can I update the parent HTML when submitting from the external HTML in the <object> tag?

Asked 2 years ago, Updated 2 years ago, 48 views

<object> When you read the external HTML with the tag and submit it within the external HTML,
Is it possible to update the parent page?

html5

2022-09-30 16:21

1 Answers

The window.parent object is available in the embedded external HTML, so you can invoke the method by referring to the parent page as follows:

object_parent.html:

<html>
<head></head>
<body>
    <h1>parent</h1>
    <object data="object_child.html"
            style="width:400; height:240px; border-style:solid; border-width:1px;">
        You have no object tag support
    </object>
</body>
</html>

object_child.html:

<html>
<head></head>
<body>
    <h2>child</h2>
    <form action="#">
        <button onclick="window.parent.location.reload()">Action!</button>
    </form>
</body>
</html>


2022-09-30 16:21

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.