javascript debug snippet