![]() |
How to detect absence of MSXML 6.0 Parser
I'm working on part of a site (see http://gis.cbmiweb.com/MDWmaps/default.asp)
where I thought everything was working fine for IE6, IE7 and Firefox. Recently, I discovered this failed for an IE7 user. The fix for that situation was to install the MSXML6.0 Parser (I would have thought that IE7 should have ensured the corresponding presence of that component). Q. Is there a simple way to test for the absence of this component? I'm thinking I could "degrade gracefully", avoid the scripting error that occurs and maybe issue an alert or something that suggests they download this component. |
Re: How to detect absence of MSXML 6.0 Parser
Here is what I found somewhere and adapted to my needs:
function testMSXml() { var xmlDocument = null; var fragment; var target; var highestVersion = 0; var currentVersion; var versionStrings = [ 'Msxml2.DOMDocument.3.0', 'Msxml2.DOMDocument.4.0', 'Msxml2.DOMDocument.5.0', 'Msxml2.DOMDocument.6.0', ]; var requiredVersion = 'Msxml2.DOMDocument.6.0'; if (ie) { if (typeof ActiveXObject != 'undefined') { for (var v = 0; v < versionStrings.length; v++) { try { currentVersion = versionStrings[v]; xmlDocument = new ActiveXObject(currentVersion); highestVersion = currentVersion; } catch (e) { break; } } } if (highestVersion && highestVersion == requiredVersion) { fragment = ''; // 'MSXML test: Found support for ' + highestVersion; return; } else { if (!highestVersion) highestVersion = 'NO SUPPORT FOUND!'; fragment = 'Required version of MSXML is: ' + requiredVersion + '. Found version: ' + highestVersion; } var para = document.createElement("p"); var target = document.getElementById("countyLeaders"); target.appendChild(para); var txt = document.createTextNode(fragment); para.appendChild(txt); countyLeaders.style.visibility = "visible"; aboutMSXML.style.visibility = "visible"; countyLeaders.style.color = "black"; } } |
| All times are GMT. The time now is 06:53 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.