bug snippets

Solving "Internet Explorer cannot open the Internet site http://xyz.com. Operation aborted."

Tagged ie6, ie7, bug, ajax, prototype, scriptaculous  Languages javascript

This bug exists in IE6 and IE7 and is caused by a JavaScript that tries to modify a tag that hasn't been closed (yet).

For example this one:

<div id="x">
  <script type="text/javascript">
  $('x').replace("wrong");
  </script>
</div>

This example fixes the problem, because the script is defined after the tag that it tries to modify:

<div id="x">
</div>
<script type="text/javascript">
  $('x').replace("correct");
</script>

See BUG: Error message when you visit a Web page or interact with a Web application in Internet Explorer: 'Operation aborted' for a detailed explanation of the problem.

Hpricot's inner_text doesn't handle HTML entities correctly

Tagged hpricot, inner_text, problem, bug  Languages ruby

Hpricot's inner_text method is fubar and doesn't handle HTML entities correctly, instead you'll see questionmarks in the output. To fix this replace calls to Hpricot's inner_text with a call to the following method (or Monkey patch Hpricot):

require 'rubygems'
require 'htmlentities'

  def inner_text(node)
     text = node.innerHTML.gsub(%r{<.*?>}, "").strip
     HTMLEntities.new.decode(text)
  end

Remember to install the htmlentities gem:

sudo gem install htmlentities

Trigger hasLayout for IE

Tagged haslayout, ie6, ie7, ie, browser, bug  Languages css
<!--[if IE]><style>
.layout {
    height: 0;
    he\ight: auto;
    zoom: 1;
}
</style><![endif]-->

How to fix 80% of IE browser issues

Tagged bug, html, ie, internet explorer, compatibility  Languages 

Tell IE to use standards mode, not quirks mode

Define your doctype in your HTML:

<!DOCTYPE> element

See: https://msdn.microsoft.com/en-us/library/cc288325(v=vs.85).aspx

Tell IE to not use compatibility mode

This prevents, for example, IE 11 from using IE 7 rendering mode which can happen for many reasons.

If you can’t add an HTTP header, then add this to your HTML and pray that it helps:

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

IE is using a compatibility mode if you see “compatible; MSIE” in the user agent header:

"Mozilla/4.0 (compatible; MSIE 7.0;"

See:

Validate your HTML and CSS

https://validator.w3.org/

Use an IE hack

Try “zoom” or “!important”.