/***********************************/ /* anAPI_Wrapper.js */ /* Function that assigns an object */ /* reference in the parent window */ /* with the call: */ /* oAPI=create_theAPI(); */ /***********************************/ function create_theAPI() { if (typeof theAPI=="undefined") { theAPI=new define_theAPI(); return theAPI } else { alert("API Already exists"); return theAPI } } /*********************************/ /* create_theAPI calls this guy, */ /* define_theAPI, which builds */ /* a container of JS functions. */ /* Once "referrenced" in the top */ /* window (frame src), any child */ /* frame reference can address */ /* the contained functions via: */ /* oAPI.isInitialized() */ /* It can persist and be re- */ /* referenced by content find API*/ /* methods. */ /*********************************/ function define_theAPI() { this.name="API"; this.id="Adapter"; this.isInitialized = function isInitialized() { if (!mInitializedState && mVERSION_2) { this.SetError(varGeneralGetFailure); } return mInitializedState; } this.SetError = function SetError(iCode) { window.MainFrame.Collection.last_code.value=iCode; } }Here's some code I googled on "really simple javascript tree":-)
// --------------------------------------------- // --- Name: Easy DHTML Treeview -- // --- Author: D.D. de Kerf -- // --- Version: 0.2 Date: 13-6-2001 -- // --------------------------------------------- function Toggle(node) { // Unfold the branch if it isn't visible if (node.nextSibling.style.display == 'none') { // Change the image (if there is an image) if (node.childNodes.length > 0) { if (node.childNodes.item(0).nodeName == "IMG") { node.childNodes.item(0).src = "minus.gif"; } } node.nextSibling.style.display = 'block'; } // Collapse the branch if it IS visible else { // Change the image (if there is an image) if (node.childNodes.length > 0) { if (node.childNodes.item(0).nodeName == "IMG") { node.childNodes.item(0).src = "plus.gif"; } } node.nextSibling.style.display = 'none'; } }Any good book recomendations or urls appreciated. I am build TVs with JS and there are DHTML listviews that are every bit as cool as some of the stuff we do with VFP. I got a lot more to learn - for sure!