working on javascript, learning, made ajax view check for ajax before sending data