extract javascript from view