Results 1 to 5 of 5

Thread: <object> tag help

  1. #1
    Join Date
    Nov 2008

    <object> tag help

    This maybe a css question, I am not sure so I posted it here.

    My basic question is: can you format a <object> tag just like a <div> tag? Is it a block level element?

    I am guessing no, since <img> is an inline element.

    The more complex question:
    In my webpage I want to use the <object> tag to dynamically change the HTML within a rectangular box. So clicking on the menu loads a different html file into the object.

    looks something like this:
    <div id="divid1">
    <object data="default.html" type="text/html">
    <p>Error Loading Content...</p>
    Then i use javascript to replace the text inside of divid1 to another object:

    function OnClickContactUs() {
    document.getElementById('divid1').innerHTML = "<object data="other.html" type="text/html"><p>Error Loading Content...</p></object>";
    Should that work or am i doing something wrong?

  2. #2
    Join Date
    Sep 2008
    We are basically doing this with one of our applications. All you need is to work with iframes.


    <a class="style677" href="dyna_design.jsp" target="target_frame" onclick="window.open(this.href, this.target)">View this code</a><br>
    <iframe src="design_pre.jsp" name="target_frame" frameborder="0" width="100%" height="410" style="background-color:F1F1F1" scrolling="no">If you can see this, your browser does not support iframes!
    What ever link is clicked then loads the href into the frame. You will need to create a page with the codes in them that you like that can be loaded into the iframe. Ihave never had problems working with iframes.

    You can then use the above link in an ordered list:

    <a class="style677" href="dyna_design.jsp" target="target_frame" onclick="window.open(this.href, this.target)">View code 1</a><br>
    <a class="style677" href="dyna_design2.jsp" target="target_frame" onclick="window.open(this.href, this.target)">View code 2</a><br>
    You can search out some code to make the list into a drop down menu.

    I hope this helps!

  3. #3
    Join Date
    Nov 2008
    I keep reading iframes is deprecated. And under strict.dtd, it is not supported? Theres also another post in this forum saying to use strict.dtd for new websites.

    anyhow, I fixed my problem.

    function OnClickContactUs() {
    document.getElementById('divid1').innerHTML = '<object data="other.html" type="text/html"><p>Error Loading Content...</p></object>';
    Notice that I had to use single quotes instead of double quotes on the code above.

    Now my problem is with the formatting. <object> tag doesn't seem to inherit the formatting from the parent div. I also assigned an id to object with the right formatting and it doesn;t work 100%. I still can't get the incoming html to be center aligned in the page.

    So I have three new questions:
    1. Should the other.html have any css formatting at all? I formatted to look exactly how I want it, so it looks good if I just load other.html by itself.
    2. Is there a trick to getting an <object> to center align?
    3. other.html is a complete webpage, it has <html>, <head>, <body>, etc. Does that whole html formatting come into my main page? I just don't get how you can have two <body> and <html> tags within one page.

  4. #4
    Join Date
    Nov 2008
    I just came upon this article:


    It says that I should use preprocessor, or server side includes to do what I want. Is that an outdated response, or is <object> still not fully supported for my needs?

    Just from my limited understanding, I am leaning towards preprocessor. Does eclipse have a plugin for an html preprocessor? If not, then my next choice would be SSI or a php script? Someone please advice me on what the easiest choice would be. Thanks
    Last edited by sdweb; 11-05-2008 at 08:08 AM.

  5. #5
    Join Date
    Mar 2005
    Sydney, Australia
    IE6 and IE7 still have a few issues with using <object> tags.

    See http://www.felgall.com/noiframe.htm for a couple of different ways of using object tags in place of iframe and the issues that those browsers have.

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



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.13681 seconds
  • Memory Usage 2,883KB
  • Queries Executed 15 (?)
More Information
Template Usage (34):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (3)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (5)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates