add javascript view hook