¡@

Home 

2014/10/16 ¤W¤È 12:02:44

jquery Programming Glossary: currentnode

Convert delimited string into hierarchical JSON with JQuery

http://stackoverflow.com/questions/6232753/convert-delimited-string-into-hierarchical-json-with-jquery

for var i 0 i input.length i var chain input i .split var currentNode output for var j 0 j chain.length j var wantedNode chain j var.. j 0 j chain.length j var wantedNode chain j var lastNode currentNode for var k 0 k currentNode.length k if currentNode k .name wantedNode.. wantedNode chain j var lastNode currentNode for var k 0 k currentNode.length k if currentNode k .name wantedNode currentNode currentNode..

Convert delimited string into hierarchical JSON with JQuery

http://stackoverflow.com/questions/6232753/convert-delimited-string-into-hierarchical-json-with-jquery

input Fred Jim Bob Fred Jim Fred Thomas Rob Fred var output for var i 0 i input.length i var chain input i .split var currentNode output for var j 0 j chain.length j var wantedNode chain j var lastNode currentNode for var k 0 k currentNode.length k .. i var chain input i .split var currentNode output for var j 0 j chain.length j var wantedNode chain j var lastNode currentNode for var k 0 k currentNode.length k if currentNode k .name wantedNode currentNode currentNode k .children break If we.. var currentNode output for var j 0 j chain.length j var wantedNode chain j var lastNode currentNode for var k 0 k currentNode.length k if currentNode k .name wantedNode currentNode currentNode k .children break If we couldn't find an item in..