Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can I make my site load as fast in Internet Explorer, as it does in Firefox?

Below is the sample html code i using in my webpage

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    </head>

    <body  topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" >

''''' Many tables and data's and images''''''
    </body>
    </html>

When i use to load above code in firefox , it working fast... that means, what load in the webpage it will display.

but in internet explorer, all code is worked then after only page load...

How i can make my code same like firefox?

hoping your response,

alex

like image 584
Alex Avatar asked Nov 06 '22 16:11

Alex


2 Answers

You can't influence the load time and order easily. There are many different layout engines out there, used by different browsers, and they are all working a bit different. And only the result is specified by web standards.

You can however load parts of the websites asynchronously using AJAX. This would mean that you didn't include a big table which takes very long to load in your main HTML file. Instead, you use some Javascript to load the table asynchronously into your website after the page has loaded.

But as long as the table isn't so big that it takes several seconds to load/render, i wouldn't bother about the problem.

like image 157
tux21b Avatar answered Nov 12 '22 12:11

tux21b


Maybe you've got markup errors that require IE's fallback algorithm to get through the whole document before working out what's wrong.

Certainly you've got an uneasy mix of XHTML syntax (/> and xmlns) with old-school HTML (really old school: the body margin attributes haven't been needed since Netscape 3 and are quite invalid even in ‘Transitional’ HTML4). And the system ID in the doctype points to a needlessly-specifically-dated version of the DTD. Maybe there are more problems.

First make sure your code passes the validator, to ensure markup errors are not to blame.

Then, for tables, prefer to set the style table-layout: fixed on them, with explicit column widths set on the first row of cells, or on <col> elements. This allows the browser to start laying out the table correctly without having to worry about the content from later on in the table affecting the widths, so you get quicker, more stable rendering.

(Though if you're still using layout for tables you should probably start looking at CSS layouts.)

like image 40
bobince Avatar answered Nov 12 '22 13:11

bobince