Recently was writing a jscript function to populate optionset value using SDK.MetaData.js helper class.
It was working fine in IE, however I was getting error in Chrome.

It turned out the following condition was always evaluating as true

And as selectSingleNode is not supported in Chrome we were getting error.
Added the following condition fixed the issue
if (typeof(window.chrome) != ‘undefined’) {
var xpe = new XPathEvaluator();
var xPathNode = xpe.evaluate(xpathExpr, node, _NSResolver, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
return (xPathNode != null) ? xPathNode.singleNodeValue : null;
}
Hope it helps..




