OBJECT tag and IE

Need technical advice on coding your web pages? Covers HTML, JavaScript, CSS, and some server side technologies. Also the issue of some webpages not displayed well.

Moderator: Don_HH2K

OBJECT tag and IE

Postby Stu » Wed 20 Nov, 2002 4:52 pm

Not strictly a Netscape problem but...

I have been experimenting with the OBJECT tag to 'embed' Flash,
Images and html files into my pages. I have a demo page set
up at http://www.trial-site.com/object.html. This
has all three types of file inserted into the page.

Netscape 7, Mozilla 1.1, Opera 7 all show the page correctly.
BUT (surprise) IE6 insists on putting a border around the
html and image objects with a 'greyed out' vertical
scroll bar.

Firstly, does anyone know how to get rid of the border and scroll
bar? and secondly, how long has Netscape been able to cope
with flash and html using OBJECT? (not embed)?

Thanks

Stu
UserAgent: Opera/7.0 (Windows XP; U) [en]
In youth we learn, in age we understand
User avatar
Stu
member
member
 
Posts: 35
Joined: Thu 03 Oct, 2002 2:06 pm
Location: Bristol uk

removing scrolling bar

Postby Antony » Wed 20 Nov, 2002 7:59 pm

Hello Stu,
If you use <iframe>, you can easily add attribute scrolling="no". I don't have quick solution now, and from my quick search from Danny Goodman's Dynamic HTML - The Definitive Reference, I only can find something related to iframe.

If you want to try...
Use Style Sheet (CSS) to override the behaviour...
Code: Select all
<style type="text/css">
document.getElementById("myObjectName").scrolling = "no";
</style>


(no guarantee it will work, but please let me know)
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 (CK-SillyDog)
User avatar
Antony
diamond member
diamond member
 
Posts: 14930
Joined: Tue 18 Jun, 2002 11:36 pm
Location: Sydney, Australia

Re: OBJECT tag and IE

Postby Hendikins » Thu 21 Nov, 2002 12:27 am

Stu wrote:how long has Netscape been able to cope
with flash and html using OBJECT? (not embed)?


Since 6.0, I believe.

As for IE/Windows, have some fun by using OBJECT to put an image in a page without specifying width/height - it will display nothing. zero zip zilch nought nada. :)
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021111
Michael Hendy
Mozilla PluginDoc - http://plugindoc.mozdev.org/
Hendikins - The Lurking Wolfox
User avatar
Hendikins
Lurking Wolfox
Lurking Wolfox
 
Posts: 617
Joined: Mon 26 Aug, 2002 5:21 am
Location: All stations to Zig Zag via the North Shore Line

Postby Stu » Thu 21 Nov, 2002 4:15 am

have some fun by using OBJECT to put an image in a page without specifying width/height - it will display nothing. zero zip zilch nought nada.


I had probems with this 'quirk' initially until I found that width/height is
a must for IE.

I have been experimenting because I have read that XHTML2.0 will drop the img tag in favour of the object tag :).

I didn't use IFRAME because (I believe) this is not supported by all browsers.
Thanks for the CSS suggestion Antony. I thought that there must be a CSS answer to this and will give it a try when I get home tonight. I'll let you know if it works.

Cheers
Stu
UserAgent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)
In youth we learn, in age we understand
User avatar
Stu
member
member
 
Posts: 35
Joined: Thu 03 Oct, 2002 2:06 pm
Location: Bristol uk

Postby Hendikins » Thu 21 Nov, 2002 4:37 am

IFRAME will do nasty things to Netscape 4 - but then again, so does OBJECT...

As for IE's behaviour - that's a bug, not a feature. The useragent should be able to determine the width/height of the object if it supports it.
UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021116
Michael Hendy
Mozilla PluginDoc - http://plugindoc.mozdev.org/
Hendikins - The Lurking Wolfox
User avatar
Hendikins
Lurking Wolfox
Lurking Wolfox
 
Posts: 617
Joined: Mon 26 Aug, 2002 5:21 am
Location: All stations to Zig Zag via the North Shore Line

Postby Stu » Thu 21 Nov, 2002 3:16 pm

Antony, thanks for trying but it doesn't work :(

This must be an IE bug/non compliance with the W3C standard.
The browser should make the object large enough to accomodate the
image/text etc without having to specify the width/height values and
scroll bars should only be added if the content does not fit the
width/height (if specified).
Borders should not be added unless specified.

I will see if I can find any way round this on the msn web site but I
don't hold out much hope.

Congratulations to Mozilla and Opera though :)
Stu
UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
In youth we learn, in age we understand
User avatar
Stu
member
member
 
Posts: 35
Joined: Thu 03 Oct, 2002 2:06 pm
Location: Bristol uk

Postby Antony » Thu 21 Nov, 2002 6:51 pm

Hendikins wrote:IFRAME will do nasty things to Netscape 4 - but then again, so does OBJECT...

<iframe> would NOT do anything to Netscape 4.
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 (CK-SillyDog)
User avatar
Antony
diamond member
diamond member
 
Posts: 14930
Joined: Tue 18 Jun, 2002 11:36 pm
Location: Sydney, Australia

Postby Stu » Fri 22 Nov, 2002 5:19 am

I have found a work around for the html object.
If I add a body tag to the html as follows:
Code: Select all
<body style="overflow:visible; border:none;">

this removes the 'window border and scroll' from the object.

Still working on the image object. It must be possible using scripting
but I haven't found a way yet.
IE will need to sort this out before xhtml 2.0 in introduced.

Stu
UserAgent: Opera/7.0 (Windows NT 4.0; U) [en]
In youth we learn, in age we understand
User avatar
Stu
member
member
 
Posts: 35
Joined: Thu 03 Oct, 2002 2:06 pm
Location: Bristol uk

Postby Antony » Fri 22 Nov, 2002 5:46 am

Stu,
Thanks for the overflow style.
However, this wont work still, but I list the syntax below.

DOM example:
Code: Select all
document.getElementById("myDiv").style.overflow = "visible";

CSS Syntax:
Code: Select all
<style type="text/css">
div.aside {overflow: visible }
</style>

Applies to:
block-level, replaced, and positioned elements.
(from Dynamic HTML - The Definitive Reference)

And, correction to my previous post:
It should be script instead.
Code: Select all
<script language="JavaScript1.2">
document.getElementById("myObjectName").scrolling = "no";
</script>


All right, I give up for this. Sorry.
However, I noticed some interesting behaviour...
Netscape 7 would squeeze and stretch the image. :-)g
Just try this...
Code: Select all
<object data="http://www.trial-site.com/images/car_mag.gif" width="340" height="420" type="image/gif" style="overflow: visible"></object>
<object data="http://www.trial-site.com/images/car_mag.gif" width="140" height="80" type="image/gif" style="overflow: visible"></object>
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 (CK-SillyDog)
User avatar
Antony
diamond member
diamond member
 
Posts: 14930
Joined: Tue 18 Jun, 2002 11:36 pm
Location: Sydney, Australia

Postby Stu » Fri 22 Nov, 2002 10:00 am

Thanks anyway Antony. I haven't done much better.
I think that the IE object image is just a patch and will need to
be corrected before xhtml 2.0 in introduced.

I have also notice that if a margin is specified around the object
then IE adds another border around the margin. :roll:

Oh well, stick with img tag for now :)

Thanks again
Stu
UserAgent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)
In youth we learn, in age we understand
User avatar
Stu
member
member
 
Posts: 35
Joined: Thu 03 Oct, 2002 2:06 pm
Location: Bristol uk


Return to Web Design and Page Coding

Who is online

Registered users: Google [Bot]