[fusion-dev] createElement fails to work on IE9 beta

Paul Spencer pspencer at dmsolutions.ca
Mon Sep 27 08:30:38 EDT 2010


This code is from within the MooTools library that we bundle with JxLib.  I'm going to check and see what they are doing about IE 9 beta, it is quite probably fixed already there and perhaps there are other bug fixes that could be relevant to IE 9.  If it isn't possible to pull in the IE9 fixes from MooTools then we'll go ahead and make the change directly in jxlib.uncompressed.js in Fusion.

Cheers

Paul

On 2010-09-27, at 12:20 AM, Zac Spitzer wrote:

> here the relevant MSDN page
> 
> http://msdn.microsoft.com/en-us/library/ff986077%28v=VS.85%29.aspx
> 
> 
> 
> On Mon, Sep 27, 2010 at 1:37 PM, Ted Yang <ted.yang at autodesk.com> wrote:
> Hi all,
> 
>  
> I’m working on IE9 support from Autodesk, and I found one defect in JxLib, this is because IE9 beta works different with IE8.
> 
> var a = document.createElement("<div>");
> 
> this code works on IE8, but not works on IE9 beta;(Note that if the web page is quite simple, the IE9 will run the page on “Quirks mode” and this code will work, but in most standard webpage this code doesn’t work)
> 
> var a = document.createElement("div");
> 
> this code works on IE9 beta, but not works on IE8;
> 
>  
> so we suggest to fix it in JxLib’s code, and I wish someone can review it and submit it before Oct. 1th.
> 
> Original code:
> 
>         Document.implement({
> 
>             newElement: function(tag, props) {
> 
>                 if (Browser.Engine.trident && props) {
> 
>                     ['name', 'type', 'checked'].each(function(attribute) {
> 
>                         if (!props[attribute]) return;
> 
>                         tag += ' ' + attribute + '="' + props[attribute] + '"';
> 
>                         if (attribute != 'checked') delete props[attribute];
> 
>                     });
> 
>                     tag = '<' + tag + '>';
> 
>                 }
> 
>                 return $.element(this.createElement(tag)).set(props);
> 
>             },
> 
>  
>             newTextNode: function(text) {
> 
>                 return this.createTextNode(text);
> 
>             },
> 
>  
>             getDocument: function() {
> 
>                 return this;
> 
>             },
> 
>  
>             getWindow: function() {
> 
>                 return this.window;
> 
>             }
> 
>  
>         });
> 
>  
>  
> Fixed code(our solution, tested on IE9 beta):
> 
>         document.newElement = function(tag, props) {
> 
>             var createdElement;
> 
>             if (Browser.Engine.trident && props) {
> 
>                 ['name', 'type', 'checked'].each(function(attribute) {
> 
>                     if (!props[attribute]) return;
> 
>                     tag += ' ' + attribute + '="' + props[attribute] + '"';
> 
>                     if (attribute != 'checked') delete props[attribute];
> 
>                 });
> 
>                 var replaceTag = '<' + tag + '>';
> 
>                 try {
> 
>                     createdElement = this.createElement(replaceTag);
> 
>                 }
> 
>                 catch (e) {
> 
>                     createdElement = this.createElement(tag);
> 
>                 }
> 
>             }
> 
>             else {
> 
>                 createdElement = this.createElement(tag);
> 
>             }
> 
>             return $.element(createdElement).set(props);
> 
>         };
> 
>  
>  
> Best Wishes,
> 
> Ted Yang (Yuanyuan Yang)
> 
> Reeses,Tel: (8621)3866-4595
> 
> <image001.png>
> 
>  
> 
> _______________________________________________
> fusion-dev mailing list
> fusion-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fusion-dev
> 
> 
> 
> 
> -- 
> Zac Spitzer 
> Solution Architect / Director
> Ennoble Consultancy Australia
> http://www.ennoble.com.au
> http://zacster.blogspot.com
> +61 405 847 168
> 
> 
> 
> _______________________________________________
> fusion-dev mailing list
> fusion-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fusion-dev


__________________________________________

   Paul Spencer
   Chief Technology Officer
   DM Solutions Group Inc
   http://research.dmsolutions.ca/



More information about the fusion-dev mailing list