Having issues with PUT request to follow a channel

I don’t think I’m qualified to answer this, but would this work?

        {
            if (xmlHttp.readyState==4) 
            {
                var check=xmlHttp.status;
  			alert(check);
  			if (check.toString()=="200")
  			{
  				success();
  			}
            }
            else 
            {
                failure("3"); // This is the step that my code fails at currently.
            }
        };