Topic
  • 1 reply
  • Latest Post - ‏2013-05-07T17:12:16Z by tmparker
richhall
richhall
20 Posts

Pinned topic Support for Internet Explorer 9

‏2013-04-22T16:14:59Z |

Hi, first I would to know if HATS version 8.x supports IE9 or not?

I am currently using HATS version 8.0.200.x.  My apps works fine in IE8, FF19.

If HATS V8 supports IE9, then I am not sure if this is a known issue.

In this HATS javascript library, hxgwfunctions.js, at line 475, it is trying to create a new element.  Here is the code:

newElement = document.createElement('<input type="radio" name="'+inElement.name+'" value="'+inElement.value+'" style="visibility:hidden" style="display:none" '+checked+'></input>');

When I run my apps, I am getting this error at this line: INVALID_CHARACTER_ERR (5)

Google it and I found that IE9 no longer allows you to pass arbitrary HTML into createElement, that's a violation of the specification

Please let me know if there is a work around / fix in place.

Thanks,

Rich

 

  • tmparker
    tmparker
    518 Posts

    Re: Support for Internet Explorer 9

    ‏2013-05-07T17:12:16Z  

    Hi Rich,

    What you are seeing is a typical issue when dealing with IE.  They do things their own way all the time and change things from version to version.  It's like trying to hit a moving target sometimes!  So the issue here is the difference between running in Quirks mode and not.  If Quirks mode is turned on in IE9 this will work as it did before with no errors.  However, with Quirks mode off and the IE9 standards setting used, you will get the error you mentioned.  There is a very good explanation of these modes here: http://blogs.msdn.com/b/ie/archive/2011/03/24/ie9-s-document-modes-and-javascript.aspx

    To get around this you have 2 options.  First, turn on Quirks mode and then it will work.  If you want to make a code change to the JavaScript to support this then you can do something like the following:

    In lxgwfunctions.js add some code to check for IE9 in some way.  I just did a simple browser agent check in this case.

    var isIE9=false;
    if(brwsusragent.indexOf('MSIE 9.0') != -1) isIE9=true
    ;

    Then on the line where you had the error just add a check for IE9 like this:

    if (((iType == "radio") || (iType == "checkbox")) && isIE && !isIE9){

    I did a quick test and this seemed to work.  Let me know what you think.

    Thanks

    Tim