Messy scratchpad while learning ajax and javascript