Har ett problem. Håller på med ett hemsidebygge och har stött på ett problem.
Använder mig av html dokument med intern css mall samt en extern javascriptfil.
Javascriptregeln går ut på att anpassa hemsidan efter den upplösning besökaren har på sin skärm.
Html filerna :
1280x800.htm
1280x768.htm
1280x720.htm
1280x600.htm
1024x768.htm
800x600.htm
Indexfilen
index.htm :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>bikerepair.se</title>
<script type="text/javascript" src="res.js">
</script>
</head>
<body>
</body>
</html>
JavaScript-filen
res.js :
if ((screen.width==1024) && (screen.height==768)) {
window.location="1024x768.htm";
}
else if ((screen.width==1280) && (screen.height==600)) {
window.location="1280x600.htm";
}
else if ((screen.width==1280) && (screen.height==720)) {
window.location="1280x720.htm";
}
else if ((screen.width==1280) && (screen.height==768)) {
window.location="1280x768.htm";
}
else if ((screen.width==1280) && (screen.height==800)) {
window.location='1280x800.htm';
}
else if ((screen.width==1280) && (screen.height==1024)) {
window.location="800x600.htm";
}
else if ((screen.width==800) && (screen.height==600)) {
window.location="800x600.htm";
}
Detta funkar klockrent i opera, chrome, ff, safari - u name it, men inte i Internet Explorer.
Hjälp mig förstå varför detta är ?
MVH Holm