-1

I'm trying to use the following code to get the availability of a domain name

var domurl = 'http://XXXXXXXXX.co.uk/domchek.php?domname=google.com';

$.getJSON(domurl, {data: "available"}, function(json) {
  $("#enterone").html(json.available);
});

The JSON returned is

{"status":"success","domain":"google","available":false}

If I use

  $("#enterone").html(json.status);

It returns success as expected but if I try and return available it returns nothing. My guess is because false is not a string (domain also works)

Any ideas? Thanks

1 Answer 1

1

An easy fix could be

$.getJSON(domurl, {data: "available"}, function(json) {
  $("#enterone").html(json.available + '');
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.