Im working with a very badly coded CMS which only works in Quirks Mode and I want to place a floating div at the right bottom of the page. I've spent the last 2 hours searching for a possible way to do this. Normally I would just: Position:fixed; but this won't work in Quirks Mode.
Is it possible to do with javascript?
If, then how?
Have you tried to change the DOCTYPE? How to get "position:fixed" css to work in IE 7+ with TRANSITIONAL doctype?
And using HTML5 doctype?
<!DOCTYPE html>
Have you tried an absolute position instead? Having the div as a child of the body tag.
Quirks mode in IE 7 can also be triggered when coding HTML 4.01 documents. Inserting a comment before the DTD will trigger this backwards compatible mode in both IE 6 and IE 7.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
or
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
and It isn't always obvious which rendering mode a browser is in. In IE address line, type in
javascript:alert(document.compatMode)
Thanks,
Brendon
Related
I have 3 situations I like to understand, but don't know the how to confirm or to test and analyse :(
In all case we use Internet Explorer Browser 9 application.
Situation 1:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<meta http-equiv="X-UA-Compatible" content="IE=10" />
As you above see the HTML pages is set meta tag is set to content=10, but we use IE9 browser. What will happens? which metag is used? What if I set content=IE11 or contentXSSDDS in meta tag? So what's the fallback?
Situation 2:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<meta http-equiv="X-UA-Compatible" content="IE=8" />
Here we use content=IE8, so does it mean IE9 features mentioned in http://msdn.microsoft.com/en-us/library/ie/dn467846%28v=vs.85%29.aspx#changes_introduced_for__ie11 are not used? I need to look a the IE8 features right?
Situation 3:
If we use IE9 or IE10 browser and we set the doctype type <!doctype html> what doctype is then used in the HTML page? I mean what engine is it used. Will it use HTML 5?
Does your content type also decide whether you can use new HTML 5 (elements or not) like etc.
correction after Jukka's right remark:
Situation 1: Browser IE9 is used and in HTM pages meta tag: content="IE8" for 1 application
Situation 2: Browser IE9 is used and in HTML pages meta tag: content="IE10" for another application
What will it do in situation 1: Will it use IE8 engine (features) and in situation 2...
For me it's not clear a browser version 9 is installed and you use content IE=10...??
I am having an IE not implemented JavaScript error and it seems not to have anything to do with what ive been reading on so far on this website.
Im using jquery.simplemodal plugin which works fine in all browsers except IE unless I change the doctype to
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
IE is pointing the error to the first line of the following code (I mean the line in bold):
s.removeExpression('height');
s.removeExpression('width');
s.setExpression('height',''+bsh+' > '+bch+' ? '+bsh+' : '+bch+' + "px"');
s.setExpression('width',''+bsw+' > '+bcw+' ? '+bsw+' : '+bcw+' + "px"');
How can I make it work in IE while using a doctype different from
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
(I would like to use this doctype
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">)
The plugin is available at http://lescracks.com/jquery.simplemodal.js . IE detects the error at line 142.
Thanks
One more thing, it also works fine in IE with the Compatibility view enabled.
.setExpression() and .removeExpression() are non-standard methods. In IE8 Microsoft removed support for them in standards mode (which the XHTML doctype triggers) because they were trying to make their browser more standards-compliant.
There's an issue in simplemodal's issue bug tracker discussing this. Apparently it has been fixed in version 1.4.1, but you're using 1.2.2. They must have stopped relying on these methods; you'll have to upgrade.
I have a page that causes IE 8 to crash. I've dumbed it all the way down to just the html/javascript that causes the crash.
I know I'm going to have to do something different for displaying the page how I want in IE without breaking it. Is anyone aware of a way that I can report this to the IE team to get it fixed?
The crash happens when you mouse over the span. Create a scratch .html file to test. Using jsfiddle doesn't crash it.
Update: Make sure IE isn't in compatibility mode to get it to crash.
Update2: It crashes in safe mode too, so it isn't an add-on causing the problem. I have tried it on multiple computers.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>test</title>
<style type="text/css">
.condPartHover
{
border-color: #000000;
background-color: #E5F0F9;
color: #1D5987;
}
</style>
</head>
<body>
<ul>
<li>
<div>Testing:
<div style="position:relative; display:inline-block; height:25px;">
<span style="position:absolute; top:0px; left:0px; border:1px solid #000000; background-color:White;" onmouseover="this.className = 'condPartHover';">test
</span>
</div>
</div>
</li>
</ul>
</body>
</html>
Is anyone aware of a way that I can report this to the IE team to get
it fixed?
Yes, go to http://connect.microsoft.com/ , enter "Internet Explorer Feedback Program" in the search box and it'll give you a link to report bugs like this to the IE team. They do read/act on them, though don't expect anything quick. Whether a bug in an old version of IE is deemed worthy of fixing I don't know though. It might be only security fixes that are still applied to IE8 nowadays, not any fix that will change the HTML rendering or Javascript behaviour.
Try with mouseOver or mouseEnter with jQuery.
$('span').mouseover(function() {
$('span').addClass("condPartHover");
});
In addition this method you are using is not HTML valid anymore.
Your doctype is incorrect and you are in quirks mode. If you must use the xhtml doctype, use this one:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
I am having an IE not implemented JavaScript error and it seems not to have anything to do with what ive been reading on so far on this website.
Im using jquery.simplemodal plugin which works fine in all browsers except IE unless I change the doctype to
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
IE is pointing the error to the first line of the following code (I mean the line in bold):
s.removeExpression('height');
s.removeExpression('width');
s.setExpression('height',''+bsh+' > '+bch+' ? '+bsh+' : '+bch+' + "px"');
s.setExpression('width',''+bsw+' > '+bcw+' ? '+bsw+' : '+bcw+' + "px"');
How can I make it work in IE while using a doctype different from
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
(I would like to use this doctype
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">)
The plugin is available at http://lescracks.com/jquery.simplemodal.js . IE detects the error at line 142.
Thanks
One more thing, it also works fine in IE with the Compatibility view enabled.
.setExpression() and .removeExpression() are non-standard methods. In IE8 Microsoft removed support for them in standards mode (which the XHTML doctype triggers) because they were trying to make their browser more standards-compliant.
There's an issue in simplemodal's issue bug tracker discussing this. Apparently it has been fixed in version 1.4.1, but you're using 1.2.2. They must have stopped relying on these methods; you'll have to upgrade.
do you know whether there is a way to not let the scrollbars in IE8 appear?
I've got a complete empty .html site and loaded it in IE8 and scrollbars are appearing.
I've been searching the net for a while, but couldn't find any hint. Is it solveable with CSS or do I need Javascript?
Every hint is much appreciated.
You can use the CSS overflow property to hide the scrollbars:
html, body {
overflow: hidden;
}
If your blank HTML page is standards-compliant (to some degree I suppose), IE8 will not display scrollbars. You shouldn't need any CSS. Here's a sample page that won't have scrollbars:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<head>
<title>test</title>
</head>
<body>
<p>hello</p>
</body>
</html>
If IE8 renders the page in Quirks Mode, it will always have scroll bars. You can check exactly what rendering it's using (and test different renderings) in the Developer Tools window (press F12). The "Browser Mode" and "Document Mode" settings at the end of the menu bar will tell you.
You can try doing overflow:hidden; in your css file, in the body,html tags.