1

I'm curious as to exactly what the flexibility is for the html5 <object> tag.

If I have a main web page set up like this

<body>
    <div id="container">
        <object data="??"></object>
    </div>
</body>

and in a separate webpage I have this:

<body>
    <div id="info">
        <p> text text blah blah text </p>
    </div>
</body>

Is there a way to pull specifically the html from the "info" div on the secondary page into the object on the primary page? If not, what kind of alternative solution should I look into?

5
  • stackoverflow.com/questions/924946/… Commented Jan 16, 2013 at 22:27
  • That is not the same question. I realize I can upload an entire page-- I'm asking if I can upload a specific element of that page only. Commented Jan 16, 2013 at 22:28
  • Great, now because of the downvote I'm going to have to ask this again. Next time please read more carefully instead of just assuming it's a repost. Commented Jan 16, 2013 at 22:31
  • What's with the negative tone? I didn't downvote. All I did was comment and fix the code formatting in your question. There aren't even any close votes on your question; why do you think you need to ask again? Commented Jan 16, 2013 at 22:35
  • Sorry if I got it wrong - seconds after I posted it, it was at -1, and you were the only one who commented on it and there was only one view so I figured it would turn up dead. Commented Jan 16, 2013 at 22:38

1 Answer 1

1

object is not an HTML5 specific tag, it also existed in HTML 4.01. It is not useful for including pages into other pages, rather it allows the page to contain Java Applets, Flash etc. The only HTML solution for including pages is the iframe tag.

You should instead insert some JavaScript that makes an AJAX call to fetch the second page. Parse it using innerHTML. Then you can select the desired element using getElementById and insert it into the container div.

If you want to do it from the server side, have a look at PHP...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.