posts data to a url through javascript