A page that works in FF, not IE, where to start

I have a page that is basically created by a DOM script that generates a table of images (regular img elements) from several webcams (helps a friend with a pet, and my HTML / DOM is a bit rusty).

It works fine in FF3 or Chrome, but not in IE7. In fact, the entire table is not visible in IE (but the background color of the body is applied).

If you look at the page in IE, there are no script errors, the CSS seems to be applied in order, and the DOM seems to display all the cells and rows in the table that are all generated.

Using the IE Developer toolbar, when you run the β€œImage” report, images are even displayed (even if they are not displayed in the table and there is no data on the table on the page, as shown in the figure), even the text in the cells isn’t rendered)

When looking at img elements and using the trace style function, at one time I saw that all img elements had a display: none, and he said inline style, but nothing happens in my code or style sheet. This problem seems to have disappeared when I started adding explicit records for each element of the table in my stylesheet.

Where to begin?

body { background-color : gray ; color : white ; margin : 0 ; font-family : Verdana, "lucida console", arial, sans-serif ; }
#CameraPreviewParent { text-align : center ; width : 100% ; }
#CameraTable { text-align : center ; width : 100% ; }
#CameraLiveParent { text-align : center ; margin : 50px ; }
#CameraLiveHeading { color : white ; }
td.CameraCell { text-align : center ; }
img.CameraImage { border : none ; }
a:link, a:visited, a:active, a:hover { text-decoration : none ; color : inherit ; }
table#CameraTable { color : white ; background-color : gray ; }
td.CameraCell { color : white ; background-color : gray ; }

Deleting a style sheet has no effect.

Here is the page code after generation (I apologize for formatting from the DOM toolbar - I tried to insert some line feeds to make reading easier):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML Strict//EN"><META http-equiv="Content-Type" content="text/html; charset=windows-1252">
<HTML>
<HEAD>
<TITLE></TITLE>
<SCRIPT src="cameras.js" type="text/javascript"> </SCRIPT>
<SCRIPT type="text/javascript">
function CallOnLoad() {
document.title = PreviewPageTitle ;         BuildPreview(document.getElementById("CameraPreviewParent")) ;
}
</SCRIPT>
</HEAD>
<BODY>
<!-- Any HTML can go here to modify page content/layout -->
<DIV id="CameraPreviewParent">
<TABLE id="CameraTable" class="CameraTable">
<TR id="CameraRow0" class="CameraRow">
<TD id="CameraCell0" class="CameraCell"><A id="CameraNameLink0" href="http://192.168.4.3:801" class="CameraNameLink">Luxury Suite 1 (1)</A><BR /><A id="CameraLink0" href="camlive.html?camIndex=0" class="CameraLink"><IMG id="CameraImage0" title="Click For Live Video from Luxury Suite 1 (1)" height="0" alt="Click For Live Video from Luxury Suite 1 (1)" src="http://192.168.4.3:801/IMAGE.JPG" width="0" class="CameraImage" /></A></TD>
<TD id="CameraCell1" class="CameraCell"><A id="CameraNameLink1" href="http://192.168.4.3:802" class="CameraNameLink">Luxury Suite 2 (2)</A><BR /><A id="CameraLink1" href="camlive.html?camIndex=1" class="CameraLink"><IMG id="CameraImage1" title="Click For Live Video from Luxury Suite 2 (2)" height="0" alt="Click For Live Video from Luxury Suite 2 (2)" src="http://192.168.4.3:802/IMAGE.JPG" width="0" class="CameraImage" /></A></TD>
</TR>
</TABLE>
</DIV><!-- This element is used to hold the preview -->
<!-- Any HTML can go here to modify page content/layout -->
</BODY>
</HTML>

-, DOM, , IE:

var PhotoWidth = 320 ;
var PhotoHeight = 240 ;

var image = document.createElement("img") ;
image.setAttribute("id", "CameraImage" + camIndex) ;
image.setAttribute("class", "CameraImage") ;
image.setAttribute("src", thisCam.ImageURL()) ;
image.setAttribute("width", PhotoWidth) ;
image.setAttribute("height", PhotoHeight) ;
image.setAttribute("alt", thisCam.PreviewAction()) ;
image.setAttribute("title", thisCam.PreviewAction()) ;
link.appendChild(image) ;

TBODY , - , 0 DOM!

+3
4

, IE, , document.createElement(), (tbody (tr (tds))). tbody .

+3

, , - IE <script>, <script src="..." /> , </script>. , , , XSLT HTML.

, , - , . , , . , , .

+1

CSS ? CSS Reset YUI Reset CSS. ( , , , .)

0

Source: https://habr.com/ru/post/1697649/


All Articles