Create layout from Javascript