JavaServerFaces

Aus Info-Theke
Zur Navigation springen Zur Suche springen


IceFaces

Einbinden von JS-Dateien

Dateibaum:

  • webapp
    • WEB-INF
    • resources
      • js
        • common.js

XML-Code:

<body<
<h:outputScript library="js" name="myice.js" />

Dump eines DOM-Knotens

function dumpNode(node, level){
 var indent = "";
 for (var ii = 1; ii <= level; ii++)
  indent = indent + " ";
 var rc = indent + "Tag: " + node.tagName + "\n";
 if (node && node.hasChildNodes()){
  var child = node.firstChild;
  while(child){
   rc = rc + indent + dumpNode(child, level + 1);
   child = child.nextSibling;
  }
 }
 while(node){
  node = node.nextSibling;
  if (node)
   rc = rc + dumpNode(node, level);
 }
 return rc;
}