js 全的样例代码,比较适合大家学习和交流

源代码在线查看: 17-4.js

软件大小: 43 K
上传用户: muye0422
关键词: js 代码 交流 比较
下载地址: 免注册下载 普通下载 VIP

相关代码

				// Recursively reverse all nodes beneath Node n, and reverse Text nodes				function reverse(n) { 				    if (n.nodeType == 3 /*Node.TEXT_NODE*/) { // Reverse Text nodes				        var text = n.data;                        // Get content of node				        var reversed = "";				        for(var i = text.length-1; i >= 0; i--)   // Reverse it				            reversed += text.charAt(i);				        n.data = reversed;                        // Store reversed text				    }				    else { // For non-Text nodes recursively reverse the order of the children				        var kids = n.childNodes;				        var numkids = kids.length;				        for(var i = numkids-1; i >= 0; i--) {       // Loop through kids				            reverse(kids[i]);                       // Recurse to reverse kid				            n.appendChild(n.removeChild(kids[i]));  // Move kid to new position				        }				    }				}							

相关资源