The 2-5 key things about healthy javascript programming habits: [A, B] I.e. don't just make random changes: inspect! (error msgs, objects, the DOM, ..) A. Notice java errors when they happen (default is silent continuing). B. Insert inline tracing calls to show the object(s). C. SHOW the args sent by a form/page to a site: i.e. use /php/showget.php as the form's ACTION to print these out clearly. D. [future] cookies: develop show for them. E. Use simple test pages to test out things, not only embedded in eventual complex pages. ================================== 0. Which version? In your browser go to: http://www.cyscape.com/showbrow.aspx http://www.csgnetwork.com/directjstestvertestjs.html ================================== A. NOTICE JAVA ERRORS: 1) Have "error console" window open and visible 2) Install onerror() handler to mk sure you notice. It pops an alert box even if error console not visible. Leave it on always in my own scripts / for expt. Off for outsider users of a service of mine. ----------------------------------- ================================== B. ad hoc IN-LINE TRACING: i.e. add code to get stuff to show itself in the output. 1) Add ad hoc code, as below 2) or else: use files trace1-3, as documented in 'trace', to print out one of my pre-prepared java trace routines about an object. ----------------------------------- Add alert() or confirm(). Change CSS to show up current element with a border, or colored bg, or color font. document.body.style.backgroundColor=color; TDptr.style.border='1em solid green' Add text to part of page: str = 'New message
'; TDptr.innerHTML = str + TDptr.innerHTML; Add an ID manually to one element, and have code look at it e.g. to print properties. PRINTING OUT VARIOUS KINDS OF THING. // Pauses till you press OK alert('entering fn. qq'); alert ('The image size is '+width+'*'+height); confirm('z') offers yes/no and returns 1/0 to the code. for (i=0; i'); for (var k in arr) document.writeln( 'Key: ' + k + ' Val: ' + arr[k] + ' nodeName: ' + arr[k].nodeName + ' Children: ' + arr[k].childNodes.length + '
'); for (var table in arr) picVisTable(arr[table], mode); //gets assoc & num 'elems' // writeln only good while page is still being gen. document.writeln('array length: ' + arr.length + '
'); for (i=0; i'); } ================================== This seems to be half-there code for seeing where clicks are heard: function traceclick(me) { //return(0); // turn OFF this tracing var str = 'Alert: ' + 'click event ' + me.nodeName + "\n"; //for(prop in me) { str+=prop + " value: " + me[prop] + "\n"; } //str += me.toString(); alert(str); // this.event.toString() // Print event stuff function clickfn(e) if (!e) var e = window.event; alert(e.type); // print type of event } ================================== Also seen in other files. function trace(str) { document.getElementById('myspan1').childNodes[0].nodeValue = str; }