save javascript trace

It's not final code. I just want to know your opinion, before I continue.