www.webdeveloper.com
Results 1 to 7 of 7

Thread: HTML tutorial for <OBJECT>

  1. #1
    Join Date
    Nov 2002
    Location
    Peterborough, UK
    Posts
    166

    HTML tutorial for <OBJECT>

    Can someone point me in the direction of a good HTML tutorial that covers <OBJECT> tags.

    I want to have a small scrollable section of HTML content in the middle of a page. The content will be changeable using a menu in a separate frame. I believe objects are what I need.

    Or, if anyone can give me a couple of quick pointers to get it going so I can play with the rest. I've tried a few references including Microsoft's but it doesn't explain how to use <OBJECT>, it just has the syntax.

    Many Thanks

  2. #2
    Join Date
    Nov 2002
    Location
    England
    Posts
    275
    Code:
    <object data="PAGE.html" type="text/html">
      Your browser does not appear to support the
      <code>&lt;object&gt;</code> element,
      the document that is supposed to be here is
      <a href="PAGE.html">PAGE.html</a>.
    </object>
    or you could try an iframe, which is probably better as it's better supported at the moment (IE has problems with object I think):

    Code:
    <iframe src="PAGE.html"
      width="90%" height="300">
      Your browser does not appear to support the
      <code>&lt;iframe&gt;</code> element,
      the document that is supposed to be here is
      <a href="PAGE.html">PAGE.html</a>.
    </iframe>
    or you could always merge the two:

    Code:
    <object data="PAGE.html" type="text/html">
      <iframe src="PAGE.html"
        width="90%" height="300">
        Your browser does not appear to support the
        <code>&lt;object&gt;</code> or the
        <code>&lt;iframe&gt;</code> element,
        the document that is supposed to be here is
        <a href="PAGE.html">PAGE.html</a>.
      </iframe>
    </object>
    But again I think IE will have problems with that, and may show a box for both the iframe and object. I'd just stick with the iframe.
    Last edited by Rick Bull; 11-25-2002 at 09:23 AM.

  3. #3
    Join Date
    Nov 2002
    Posts
    4,473

    <OBJECT> tag

    The tag is simple. The contents of the tag is what gets complicated, and the rules are different and specific for whatever object is contained in the tag. You have to find the rules for the specific object.

    For example, if you need to make a MediaPlayer object, you would have to go to Microsoft's MediaPlayer documentation to find out how to set the tag.

    It really doesn't have much to do with HTML. The object is a system thing rather than a browser thing. It's like a window in the browser to another application.

    An <OBJECT> can even be another HTML document, as explained by Rick.

    Interestingly, the <OBJECT> in NS 4 acts almost identically to the <IFRAME> in IE.
    Last edited by gil davis; 11-25-2002 at 09:47 AM.

  4. #4
    Join Date
    Nov 2002
    Location
    Peterborough, UK
    Posts
    166
    I'm using IE 5.5 and Rick's <OBJECT> example did not work. The <IFRAME> does precisely what I want though so I guess I'll go with that. How do I create a link to change the contents of the <IFRAME> ?? What about from a separate <FRAME>

  5. #5
    Join Date
    Nov 2002
    Posts
    4,473

  6. #6
    Join Date
    Nov 2002
    Location
    England
    Posts
    275
    Just in case you're like me and are too lazy to read Gil's link, you just add a name to the iframe (<iframe name="targetMe">) then target your links (<a href="#" target="targetMe">).

  7. #7
    Join Date
    Nov 2002
    Location
    Peterborough, UK
    Posts
    166
    I was in the process of reading that link.

    I was trying all sorts of extravagant javascript to get it to work with no luck. Thanks for that Rick, I can't believe it was so simple.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles