From b105666b770081807a7af0846f87906641c10a79 Mon Sep 17 00:00:00 2001 From: Jakub Skoczen Date: Wed, 12 Mar 2008 11:36:57 +0000 Subject: [PATCH] FIXED: pz2.js would break in IE because the DOMElement is missing hasAttributes method. (bug #2103) --- js/pz2.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/js/pz2.js b/js/pz2.js index 21990d0..94d83ae 100644 --- a/js/pz2.js +++ b/js/pz2.js @@ -1,5 +1,5 @@ /* -** $Id: pz2.js,v 1.69 2008-02-14 12:20:24 jakub Exp $ +** $Id: pz2.js,v 1.70 2008-03-12 11:36:57 jakub Exp $ ** pz2.js - pazpar2's javascript client library. */ @@ -933,18 +933,16 @@ Element_parseChildNodes = function (node) } } - if (node.hasAttributes()) { - var attrs = node.attributes; - for (var i = 0; i < attrs.length; i++) { - var attrName = '@' + attrs[i].nodeName; - var attrValue = attrs[i].nodeValue; - parsed[attrName] = attrValue; - } + var attrs = node.attributes; + for (var i = 0; i < attrs.length; i++) { + var attrName = '@' + attrs[i].nodeName; + var attrValue = attrs[i].nodeValue; + parsed[attrName] = attrValue; } // if no nested elements, get text content if (node.hasChildNodes() && !hasChildElems) { - if (node.hasAttributes()) + if (node.attributes.length) parsed['textContent'] = node.firstChild.nodeValue; else parsed = node.firstChild.nodeValue; -- 1.7.10.4