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开发者_JS百科" 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
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.
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.)
Avoid
''''' Many tables and data's and images''''''
for website design, use tables only for tabular data, also try to use css instead of inline styling as I see with your body tag you can do that from css
body{
margin:0;
}
Maybe reading some articles like this may improve your skills :
https://stackoverflow.com/questions/72394/what-should-a-developer-know-before-building-a-public-web-site
or
http://developer.yahoo.com/performance/rules.html
There's no silver bullet to do this, but as a general rule of thumb you can help any rendering engine by being as explicit as possible.
For example: If your tables have auto-sizing columns Internet Explorer will load all cells to determine the actual table layout before displaying anything.
You can circumvent that problem by explicitly setting all columns widths.
The same goes for images. If you can, add width and height information to all img
elements, so that the rendering engine does not load the image, to determine the dimensions of the img
element.
Although you want faster page loads in Internet Explorer, try using the YSlow Firefox addon to determine any general bottlenecks of your page. It's quite possible that any (undetected) problem has a much more profound impact on Internet Explorer than Firefox.
You could use CNAMEs (DNS aliases) to split your images across multiple hostnames.
yahoo
精彩评论