> I load a external javascript in a DIV. I set the width and border of
> the DIV. It looks as intended in Firefox, but IE7 is doing something
[quoted text clipped - 21 lines]
> type="text/javascript"></script>
> </div></body></html>

Signature
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
On Nov 8, 11:35 am, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
> > I load a external javascript in a DIV. I set the width and border of
> > the DIV. It looks as intended in Firefox, but IE7 is doing something
[quoted text clipped - 11 lines]
> an invalid Content-Type[3]) to a user agent that does not even support
> XHTML[4], much less provides for an XHTML DOM. Clue^WNeedlessly.[5]
You are, of course, quite right. I updated the DTD and validated the
code.
The CSS validator doesn't like class names with underscores, but
again, I have no control over what is sent from the remote site.
My very simple example at http://franklloydwright.tercenim.com/newstest.htm
has been updated, and here is the complete content:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://
www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<title>Newsfeed test</title>
<style type="text/css">
div#inform-wrapper {width:482px; float: left; border: 3px solid #000;}
.pic {
float: left;
height: 175px;
width: 120px;
padding: 15px;
margin: 5px 3px;
border: 1px solid white;
background: #555;
}
.pic img {
border: 1px solid;
border-color: #444 #AAA #AAA #444;
}
.ls img {
height: 163px;
width: 110px;
margin: 32px 0 0;
}
.pt img {
height: 256px;
width: 192px;
margin: 0px 32px;
}
.ls_title {
background-image: none;
list-style: none;
text-align: center;
color: #fff;
font: bold 9px Verdana, sans-serif;
margin: 32px 0 0 0;
display: block;
}
.pt_title {
background-image: none;
list-style: none;
text-align: center;
color: #fff;
font: bold 9px Verdana, sans-serif;
margin: -4px 0 0 0;
margin: 0;
display: block;
}
</style></head>
<body>
<div id="inform-wrapper">
<p><a href="http://widget.inform.com/Frank%20Lloyd%20Wright">Frank
Lloyd Wright News</a></p>
<script src="http://widget.inform.com/widget/Frank%20Lloyd%20Wright"
type="text/javascript"></script>
</div>
</body>
</html>
Thomas 'PointedEars' Lahn - 30 Nov 2007 00:29 GMT
> On Nov 8, 11:35 am, Thomas 'PointedEars' Lahn <PointedE...@web.de>
> wrote:
[quoted text clipped - 15 lines]
>
> The CSS validator doesn't like class names with underscores,
The W3C's does. It would seem your validator validates against CSS1
or does not implement
http://www.w3.org/Style/css2-updates/REC-CSS2-19980512-errata.html
(implemented also in CSS 2.1).
> but again, I have no control over what is sent from the remote site.
>
> My very simple example at http://franklloydwright.tercenim.com/newstest.htm
> has been updated, and here is the complete content:
>
> [...]
The reason is that with
<script src="http://widget.inform.com/widget/Frank%20Lloyd%20Wright"
type="text/javascript"></script>
the following code is also executed:
-------------------------------------------------------------------
/* initialize the list */
Inform.ArticleData.init = function ()
{
this.wrapper = document.getElementById("inform-wrapper");
if (!this.wrapper || this.wrapper.getElementsByTagName("A").length == 0)
{
alert("Improper integration.");
return;
};
this.render();
};
// [...]
/* render the list */
Inform.ArticleData.render = function ()
{
this.clearWrapper();
this.renderArticleList();
this.renderStyleSheet();
};
/* add the stylesheet with the default elements */
Inform.ArticleData.renderStyleSheet = function ()
{
if (document.getElementById("inform-stylesheet"))
{
return;
};
var styleSheet = Inform.Utils.createElement("LINK", {
href: this.hostname + "/inform2/feeds/resources/css/search-module.css",
type: "text/css",
rel: "stylesheet",
id: "inform-stylesheet"
});
var docHead = document.getElementsByTagName("head")[0];
if (docHead.childNodes.length)
{
docHead.insertBefore(styleSheet, docHead.firstChild);
}
else
{
docHead.appendChild(styleSheet);
};
};
// [...]
Inform.ArticleData.init();
-------------------------------------------------------------------
Basically, it inserts a new `link' element before all other child elements
of the `head' element (i.e. if the `head' element has any, as it should
have, it inserts it before the first child element; if it has not, as it
should not have, it inserts it at the end of the element's content.)
That `link' element refers to a stylesheet that contains the following:
/* -----------------------------------------------------------
news widget wrapper
-------------------------------------------------------------- */
div#inform-wrapper
{
width: 200px;
border: 1px solid #b2c2cf;
font: normal 12px arial, sans-serif;
padding: 8px;
/* for the floats */
overflow: hidden;
}
So it would seem Firefox gets it right: since your stylesheet still comes
last, it should take precedence over the the included one. However, IE 7
seems to "think" differently and lets the stylesheet included by the newly
added element to take precedence, regardless of the former's position in the
document tree.
As for a solution, you could give your stylesheet the ID "inform-stylesheet"
so that the default stylesheet is not included at all by the above script.
Other than that, I don't think you can realistically do anything about it.
HTH
PointedEars

Signature
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16