diff options
author | teramako | 2013-02-11 21:33:23 +0900 |
---|---|---|
committer | teramako | 2013-02-11 21:33:23 +0900 |
commit | aa354ab95bd6a31e218264e224aa7e9838cfc983 (patch) | |
tree | 5e8328599083a9507fa5a8a2f834c37ab9b4504b /lookupDictionary.js | |
parent | 66351c964772c19f84116694c09a270b8e5a0b18 (diff) | |
download | vimperator-plugins-aa354ab95bd6a31e218264e224aa7e9838cfc983.tar.bz2 |
変な書き方を修正
Diffstat (limited to 'lookupDictionary.js')
-rw-r--r-- | lookupDictionary.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lookupDictionary.js b/lookupDictionary.js index 3acfeca..4ca4e39 100644 --- a/lookupDictionary.js +++ b/lookupDictionary.js @@ -250,8 +250,10 @@ function getNodeFromXPath(xpath,doc,isMulti) { if (isMulti) { let nodesSnapshot = doc.evaluate(xpath,doc.documentElement,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null); if (nodesSnapshot.snapshotLength == 0) return; - result = document.createElementNS(null,'div'); - for (let i=0; i<nodesSnapshot.snapshotLength; result.appendChild(nodesSnapshot.snapshotItem(i++))); + result = doc.createElementNS(XHTML.uri,'div'); + for (let i=0, len = nodesSnapshot.snapshotLength; i<len; i++) { + result.appendChild(nodesSnapshot.snapshotItem(i)); + } } else { let node = doc.evaluate(xpath,doc.documentElement,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null); if (!node.singleNodeValue) return; |