|
Prev: Divs within a form (referencing in Javascript)
Next: Why do this? <SCRIPT TYPE="text/javascript"
From: nobody on 6 May 2008 20:17 On Tue, 06 May 2008 21:36:14 +0200, Thomas 'PointedEars' Lahn <PointedEars(a)web.de> wrote: >nobody(a)nowhere.net wrote: >> Ever tried to use MS VS.NET for debugging JS? Try it, and you'll >> never want to use anything else. > >I have tried it, and I prefer the MS Script Debugger for JScript, for its >not being evaluation software that cannot be registered, and its comparably >small memory footprint. Never wanting to use anything else would be >nonsense anyway because MS VS.NET can only debug JScript, not JavaScript or >other ECMAScript implementations. It attaches to IE and debugs _any_ script currently running - be that MS-only JScript, plain vanilla JavaScript, or even (cough!) vbscript. > >> [...] >> And to see dynamically built object html, try entering into IE address >> bar javascript:alert(document.getElementById('some id').innerHTML); >> Works with FF, too. > >I prefer Firebug for debugging scripts in Firefox; you definitely should try >that. Thanks, I surely will. > > >PointedEars
From: nobody on 6 May 2008 20:28 On Tue, 06 May 2008 07:54:25 -0400, sheldonlg <sheldonlg> wrote: >nobody(a)nowhere.net wrote: > >> And to see dynamically built object html, try entering into IE address >> bar javascript:alert(document.getElementById('some id').innerHTML); >> Works with FF, too. > >Thanks. That was [almost] great. The "almost" is because I can't cut >and paste it. If I could do the cut and paste, I could either (a) >format it nicely to see where I may have made a mistake or (b) put it >into a separate html file that I could then validate and have W3C do >that work for me. Is there a variant that would allow me to do that. > >BTW, IE changes things slightly. It removes the quotes around things >like class="thisclass" whereas FF doesn't. However, the formatting in >IE is somewhat better in starting new lines. OK, here's a 'greater' implementation that answers your prayer - but much more heavyweight. You enter into IE address bar javascript:getIt([some id], [optional true]); The optional parameter doesn't work with FF due to outerHTML not being a part of its object model, but setting it to false or just omitting works. NNN <textarea id="src" rows="20" cols="150" style="display:none;" comment="I am here for testing only. Delete me in Production."></textarea> <script language="javascript" type="text/javascript"> ////////////////////////////////////////////////////////////////////////////// function getIt(id,outer) { //test function - displays ACTUAL HTML of the object corresponding "id" var ta=Get('src'); if(!ta) { alert('not available in this Release'); return; } var target=Get(id); if(target) { ta.value=(outer?target.outerHTML:target.innerHTML); ta.style.display='block'; } else alert(id+' does not correspond to any object on the page'); } </script>
|
Pages: 1 Prev: Divs within a form (referencing in Javascript) Next: Why do this? <SCRIPT TYPE="text/javascript" |