adding event when js script starts running
Merge #649 r=@jiahuang: adding event when js script starts running