Simply lean ajax javascript function