Load javascript at the end of the file as it was before

Change-Id: I25c95885cfb8086554fa9da0bf1aa1826774e664