-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

dumbass
27.2k4 gold badges43 silver badges77 bronze badges
asked Nov 18, 2013 at 4:05

1 Answer 1

1

An easy fix could be

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

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.