CodingTrace JS script

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  Peter (BOUGHTONP)  
 To:  Mikee      
32270.5 In reply to 32270.3 
Oh. That suggests you haven't heard of Firebug, which can do that, and several other handy things too (especially CSS tools).
0/0
 Reply   Quote More 

 From:  Mikee   
 To:  Peter (BOUGHTONP)     
32270.6 In reply to 32270.5 
You did not read the message you replied to, in which i mentioned firebug.

My script uses firebug if it can find it. If not (i.e. if you're debugging in IE), it creates its own console.

New version..

Allows error reporting now
example:

javascript code:
 
function myfun (){
 try {
  // cause an error here
 }catch(e){
  trace.error(e);
 }
}


Also it can be enabled from the query string using ?trace.
If you want to filter what is shown, you can use ?trace=log|error and remove the one you dont want.



[Mwah]

Attachments:
tracer.js

0/0
 Reply   Quote More 

 From:  Mikee   
 To:  ALL
32270.7 
bug ironed out



[Mwah]

Attachments:
tracer.js

0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Mikee      
32270.8 In reply to 32270.6 
I did read your message... except for that second sentence, which I somehow missed. :$


But there is a Firebug Lite which provides a console for IE/etc, so I'm still a bit miffed.
0/0
 Reply   Quote More 

 From:  Mikee   
 To:  Peter (BOUGHTONP)     
32270.9 In reply to 32270.8 

It's simply a fallback for if you dont have firebug installed.

 

It also avoids you having to take out all of the console.log's every time you want to show a client it working in action while it's in development.




[Mwah]
0/0
 Reply   Quote More 

 From:  milko  
 To:  Peter (BOUGHTONP)     
32270.10 In reply to 32270.8 
You're not miffed.

milko
0/0
 Reply   Quote More 

 From:  Mikee   
 To:  ALL
32270.11 
Added an extra (optional) thing called "sources".

trace.log("hello", "mysource");
trace.error(e, "mysource");

you can then filter by sources.

Generally I try to use either class names or function names.

I.e.

javascript code:
 
 function testicals(){
  try{
   var mystring = "hello this is my string";
   trace.log(mystring ,"testicals()");
  }catch(e){
   trace.error(e ,"testicals()");
  }
 }
 
 function boobies(){
  try{
   var mystring = "hello this is my string";
   trace.log(mystring ,"boobies()");
  }catch(e){
   trace.error(e ,"boobies()");
  }
 }



[Mwah]

Attachments:
tracer.js

0/0
 Reply   Quote More 

Message 32270.12 was deleted

 From:  Sulkpot  
 To:  Mr (M00RL0CK)     
32270.13 In reply to 32270.12 
*a big spazzy spaz.

0/0
 Reply   Quote More 

 From:  THERE IS NO GOD BUT (RENDLE)  
 To:  Sulkpot     
32270.14 In reply to 32270.13 
Ahem.

0/0
 Reply   Quote More 

 From:  Mikee   
 To:  ALL
32270.15 

New version with a couple of big bug fixes.

 

code getting pretty messy now so I might rewrite it as a class if anyone is interested in it.




[Mwah]

Attachments:
tracer.js

0/0
 Reply   Quote More 

 From:  Mikee   
 To:  ALL
32270.16 
Updated again. Now with type reporting and whatnot.

Also added a demo page here to see it in action with a very very simple page.



[Mwah]

Attachments:
tracer.js

0/0
 Reply   Quote More 

 From:  andy  
 To:  Mikee      
32270.17 In reply to 32270.16 
i like it! good job
0/0
 Reply   Quote More 

 From:  Mikee   
 To:  ALL
32270.18 

Added HTML dom object highlighting.

 

fixed bugs.

 

Example of html dom highlighting:

 

http://www.beentheretogether.co.uk/code/tracer/htmlelm.php?trace

 

Note: only tested in IE so far.




[Mwah]
0/0
 Reply   Quote More 

Reply to All    
 

1–18

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats