A rather specific question I realize, but I can’t pinpoint this bug to either headjs or jquery, otherwise I would have asked there.
When aysnc loading jquery using headjs, I noticed that when testing in IE8 the background-color set on BODY is ignored. This only happens in IE8 standards-mode and only AFTER jquery is loaded. (on initial page load the background-color is represented correctly) .
I really have no idea what’s going on, but it’s driving me nuts.
I simplified the problem down to the code below. Testing suggests this only happens in:
-
IE8 standards mode, not quirks mode (i.e: removing resolves this problem)
-
combination with jquery 1.6.1, it functions correctly with jquery 1.5.1
-
combination with headjs. When just including jquery using , it’s no problem
just open in IE8 and see for yourself. Background should be red but goes to white after jquery is loaded. Any ideas?
<!doctype html>
<html>
<head>
<script src="https://raw.github.com/headjs/headjs/v0.96/dist/head.js"></script>
<style>
body{
background:#f00;
}
</style>
<script>
head.js("//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js");
</script>
</head>
<body>
test
</body>
</html>
As stated in the comment:
“ok this seems to be a jquery bug: see: stackoverflow.com/questions/6149820/weird-ie8-layout-glitch and bugs.jquery.com/ticket/9440. It’s fixed in the upcoming 1.6.2”