Hi All,
I am facing an issue in in MicrosoftAjaxTemplates.js file while template using data binding. I am using 4.0.0.0 version with subversion 4.0.20227.0.
The problem only occurs in IE10 and IE9 not in FF, Chrome, IE8.
After digging, I found, its due to wrong assumption that all IE versions would not be worked with DOM attributes.
The issue is with following line of code.
Here, useDirect=true when browser is IE.(No matter which version is). Now IE9+ version respects DOM attributes and not support collection of attributes anymore.
types = useDirect ? element[namespaceMappings.types] : element.getAttribute(namespaceMappings.types);
I have also tried with latest version of MicrosoftAjaxTemplate.js which is now available with MicrosoftAjaxToolkit 40412. The same is present in latest version of library.
I have updated the above code as below to make template binding working.
if (useDirect)
types = element[namespaceMappings.types];
if (!types)
types = element.getAttribute(namespaceMappings.types);
I am posting this here as may be other people also facing same kind of issue and are there any planning to update this library as many people may using this library directly from the CDN and for them it is not possible to update the CDN source code.
Tejas Trivedi.
Techinical Lead,
IGATE Global Solutions Ltd.
I am facing an issue in in MicrosoftAjaxTemplates.js file while template using data binding. I am using 4.0.0.0 version with subversion 4.0.20227.0.
The problem only occurs in IE10 and IE9 not in FF, Chrome, IE8.
After digging, I found, its due to wrong assumption that all IE versions would not be worked with DOM attributes.
The issue is with following line of code.
Here, useDirect=true when browser is IE.(No matter which version is). Now IE9+ version respects DOM attributes and not support collection of attributes anymore.
types = useDirect ? element[namespaceMappings.types] : element.getAttribute(namespaceMappings.types);
I have also tried with latest version of MicrosoftAjaxTemplate.js which is now available with MicrosoftAjaxToolkit 40412. The same is present in latest version of library.
I have updated the above code as below to make template binding working.
if (useDirect)
types = element[namespaceMappings.types];
if (!types)
types = element.getAttribute(namespaceMappings.types);
I am posting this here as may be other people also facing same kind of issue and are there any planning to update this library as many people may using this library directly from the CDN and for them it is not possible to update the CDN source code.
Tejas Trivedi.
Techinical Lead,
IGATE Global Solutions Ltd.