add an option to determine whether we should remove javascript node after loading