Opened 9 years ago
Closed 7 years ago
#15246 closed enhancement (fixed)
[patch][cla] dojo/request/handlers.js (1.8 ?) trying various activeX versions in every request ?
Reported by: | mm | Owned by: | Bryan Forbes |
---|---|---|---|
Priority: | high | Milestone: | 1.10 |
Component: | IO | Version: | 1.7.2 |
Keywords: | Cc: | ben hockey | |
Blocked By: | Blocking: |
Description
I would like to suggest to test once instead in each call for available version of activeX object. I know yhat it is very likely that 90% will have version 6 and loop will exit with first iteration but anyway creating ActiveX and failing is quite expensive way.
if(has('activex')){
var dp = array.map([6, 4, 3, 2], function(n){
return 'MSXML' + n + '.DOMDocument';
}); dp.unshift('Microsoft.XMLDOM');
handleXML = function(response){
var result = response.data;
if(!result !result.documentElement){ var text = response.text; array.some(dp, function(p){
try{
var dom = new ActiveXObject(p); dom.async = false; dom.loadXML(text); result = dom;
}catch(e){ return false; } return true;
});
}
return result;
};
}
Change History (10)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
Component: | General → IO |
---|---|
Owner: | set to Bryan Forbes |
comment:3 Changed 9 years ago by
Cc: | ben hockey added |
---|
comment:4 Changed 9 years ago by
Milestone: | tbd → 1.8 |
---|---|
Priority: | undecided → high |
I think this should be addressed for 1.8 since this is the last major release where we're definitely supporting IE6.
comment:5 Changed 9 years ago by
I'm not sure what you mean by "test once instead in each call". As far as I can tell, this test is performed only once, when the module initially loads. Perhaps you're confusing the factory function with the handle
function (which is what would actually be called once per request)?
comment:6 Changed 9 years ago by
There are two parts to this: the array composition and the handleXML
function. Both parts have a loop in them and
handleXML
is run once per request that has
{ handleAs: 'xml' }
set on it. That being said, I wasn't sure if different versions of Microsoft's parser would work on certain documents where others would not which is why I have the routine testing which passes and fails for each request. If that isn't the case, we can certainly move the check for which library to use outside of the handleXML function.
comment:8 Changed 9 years ago by
Milestone: | 1.8 → 2.0 |
---|
1.8 is frozen. Move all enhancements to next release. If you need an exemption from the freeze for this ticket, contact me immediately.
comment:9 Changed 7 years ago by
Milestone: | 2.0 → 1.10 |
---|---|
Summary: | dojo/request/handlers.js (1.8 ?) trying various activeX versions in every request ? → [patch][cla] dojo/request/handlers.js (1.8 ?) trying various activeX versions in every request ? |
comment:10 Changed 7 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
talking about array.some inside of handleXML if not clear