Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    Regular Coder
    Join Date
    Jun 2005
    Posts
    153
    Thanks
    26
    Thanked 0 Times in 0 Posts

    Dynamically Expanding Embedded Objects

    Is there a way to get <object>'s to expand depending on content?

    I tried to style="overflow: visible;" and this didn't work either. Is there a solution?

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,667
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello questionable,

    Expanding to fit it's content is <object>'s normal behavior.

    Can you show us how you're using it?
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    Regular Coder
    Join Date
    Jun 2005
    Posts
    153
    Thanks
    26
    Thanked 0 Times in 0 Posts
    I'm using it with like this:

    Code:
    <object data="resultedinfo.php"></object>
    However, it only shows in a box that looks like it's 400px by 300px

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,667
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    What size is resultedinfo.php? What styles resultedinfo.php? What styles <object>? What contains <object>?
    And, since there is some question as to browser support for <object>, what browser are you seeing the problem in?

    Not to sound rude or anything but this information is needed to figure out a solution to your problem. A little help from you (see #3) would go a long ways toward finding an answer.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #5
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,274
    Thanks
    28
    Thanked 271 Times in 265 Posts
    Quote Originally Posted by questionable View Post
    I'm using it with like this:

    Code:
    <object data="resultedinfo.php"></object>
    However, it only shows in a box that looks like it's 400px by 300px
    As far as I'm aware, the object element, like the iframe element, does not resize to fit the content of document types such as HTML and XHTML (which is what I presume the PHP output is). It will resize to fit content with an intrinsic width (i.e., images), but that's about it; otherwise, you get a default width unless you specify one. If I'm not mistaken, the default is 300150 pixels per the CSS spec.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #6
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,667
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    So questionable, if the php output is html ... what is the reason for putting it in <object> tags?
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #7
    Regular Coder
    Join Date
    Jun 2005
    Posts
    153
    Thanks
    26
    Thanked 0 Times in 0 Posts
    Yes Arbitrator, the output is html. I originally used an iframe but I've been told that the object tag is more versatile. Is there anyway to get either of these to auto resize so the content isn't the default size?

    Thanks

  • #8
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,274
    Thanks
    28
    Thanked 271 Times in 265 Posts
    Quote Originally Posted by Excavator View Post
    So questionable, if the php output is html ... what is the reason for putting it in <object> tags?
    If I'm not mistaken, the iframe element is disallowed in HTML 4.01 Strict because the intention was that the object element would replace it.

    Quote Originally Posted by questionable View Post
    Yes Arbitrator, the output is html. I originally used an iframe but I've been told that the object tag is more versatile.
    Given the implementation problems, I'm not so sure about that. It's more versatile than, say, the img element since you can use markup as fallback, but for HTML pages, I'm not so sure.

    Quote Originally Posted by Excavator View Post
    Is there anyway to get either of these to auto resize so the content isn't the default size?
    Yes, using the CSS/HTML width and height properties/attributes you can do this.

    I assume you misspoke though and meant to ask if there was a way to get the frame to size to the document. As far as I'm aware, there is no way to do this with HTML 4.01. The closest you could get it to parse the document with a server-side language and add the output to your document (on the server side).

    HTML 5 will allow this with the seamless attribute on iframe elements, I believe, but I'm not aware if any browser vendor that has implemented it yet. object apparently lacks a new, similar attribute.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #9
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Javascript can be used to resize an iframe to its content but it may not be able to do the same using an object tag. I am also questioning the use of using an object element. Why not just use include to put the php file into your page?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #10
    Regular Coder
    Join Date
    Jun 2005
    Posts
    153
    Thanks
    26
    Thanked 0 Times in 0 Posts
    Thanks Aerospace_Eng_!

    That solved my problems. <div>'s don't have a src attribute but I was able to use:

    (Using jQuery):
    Code:
    url = document.location.href+"?findme="+escape(findthis);
    $.get(url, function(data)
    {
    	$("#addToPage").html(data);
    });
    On Page:
    Code:
    <div id="addToPage"></div>
    Last edited by questionable; 12-30-2009 at 04:10 PM.


  •  

    Posting Permissions

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