first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

JavaScript Code: DOM Routines; Dom.js; Abandoned Code

function jsAnchorElement() { var vCount = arguments.length

var oElement = window.document.createElement('a')

if(vCount > 0) oElement.href = arguments[0]
if(vCount > 1) oElement.innerHTML = arguments[1]
if(vCount > 2) oElement.id = arguments[2]
if(vCount > 3) oElement.className = arguments[3]
if(vCount > 4) oElement.title = arguments[4]

return oElement

}

function jsDivElement() { var vCount = arguments.length

var oElement = window.document.createElement('div')

if(vCount > 0) oElement.innerHTML = arguments[0]
if(vCount > 1) oElement.id = arguments[1]
if(vCount > 2) oElement.className = arguments[2]

return oElement

}

function jsImageElement() { var vCount = arguments.length

var oElement = window.document.createElement('img')

if(vCount > 0) oElement.src = arguments[0]
if(vCount > 1) oElement.alt = arguments[1]
if(vCount > 2) oElement.id = arguments[2]
if(vCount > 3) oElement.className = arguments[3]

return oElement

}

/*

function jsTableElement() { var vCount = arguments.length var oXmlRows = null var oTableFormatting = null

var oElement = window.document.createElement('table')

if(vCount > 0) oXmlRows = arguments[0]
if(vCount > 1) oElement.id = arguments[1]
if(vCount > 2) oElement.className = arguments[2]
if(vCount > 3) oTableFormatting = arguments[3]

var oRow = null
var oCell = null

for(var y = 0;y < oXmlRows.length;y++)
{
    oRow = window.document.createElement('tr')
    for(var x = 0;x < oXmlRows[y].childNodes.length;x++)
    {
        if(oXmlRows[y].childNodes[x].nodeType == 1)
        {
            oCell = window.document.createElement('td')
            oCell.innerHTML = oXmlRows[y].childNodes[x].firstChild.nodeValue
            oRow.appendChild(oCell)
        }
    }
    oElement.appendChild(oRow)
}

return oElement

}

function TableFormatting() { this.firstColumnIsHeader = null this.headerArray = null this.oddRowClassName = null this.useElementNames = null this.lastRowClassName = null this.columnArray = null }

*/

mod date: 2005-12-03T06:30:35.000Z