Prelim edit page JS code