Unstoppable Domains

[PHP+AJAX] Domain Availabilty Checker - Checks tlds

Spaceship Spaceship
Watch
Hey everyone!

First credits go to ADAM and MATTEW for the basic script all I did to this was made it AJAX.

Demo :


A live demo goes here at my blog http://www.hakc.net/scripts/domainjax/

I've got to add much more to this script so beat at your seats! I'll be adding more web 2.0 features!

Script
The Index file :
Code:
<html>
<body>
<head>
<title></title>
</head>
<link href="main.css" rel="stylesheet" />

<script language="javascript" type="text/javascript" src="ajax.js"></script>
<center>
	<form method="post" action="./" id="form">
		<input type="text" name="domain" />
		<br /><br /><input type="submit" value="Check Availability" style="font-size: 10pt;" />
		
	</form>
		<div id="loading"><img src="inc/loading.gif"></img></div>
 <div id="results"></div>	
 </center>
 </body>
 </html>

The AJAX handler :

Code:
var xml = makeXML();
var form;
var loading;
var results;
function makeXML () {
	if (typeof XMLHttpRequest == 'undefined') {
		objects = Array(
			'Microsoft.XmlHttp',
			'MSXML2.XmlHttp',
			'MSXML2.XmlHttp.3.0',
			'MSXML2.XmlHttp.4.0',
			'MSXML2.XmlHttp.5.0'
		);
		for (i = 0; i < objects.length; i++) {
			try {
				return new ActiveXObject(objects[i]);
			} catch (e) {}
		}
	} else {
		return new XMLHttpRequest();
	}
}
window.onload = function () {
	form = document.getElementById('form');
	loading = document.getElementById('loading');
	results = document.getElementById('results');
	form.onsubmit = function () {
		results.style.display = 'none';
		results.innerHTML = '';
		loading.style.display = 'inline';
		xml.open('get', './process.php?domain=' + escape(this.domain.value));
		xml.onreadystatechange = function () {
			if (xml.readyState == 3 && xml.status == 200) {
				results.style.display = 'block';
				results.innerHTML = xml.responseText;
				loading.style.display = 'none';
			}
		}
		xml.send(null);
		return false;
	}
}

Download the complete Package here !

Script is totally free to use modify and use anywhere wanted, but cannot be sold under any circumstances.

-- 3l3ctr1c
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Not bad, but AJAX really needed for 1 submit form?

I dont think AJAX is necessary for this.
 
0
•••
. Adam . said:
Not bad, but AJAX really needed for 1 submit form?

I dont think AJAX is necessary for this.

Although they are my words (adam - ;)) it depends on how it is used i guess, personally for something like this i don't recommend ajax but i suppose it does no harm.

Thanks for the credits 3l3ctr1c :)
 
0
•••
lol

Yea thanks for credits ;)
 
0
•••
I felt like ajaxing it, and did it, but I love to see AJAX everywhere! Actually the ready.state was set to 3 so that results can be shown as they're fetched but I don't know what changed after it went to my host.
 
0
•••
I prefer AJAX actually.

Gives it a more, modern, professional feel. :tu:
 
0
•••
What about credit to me for coming up with that beautiful AJAX system? Stealing code and claiming as your own is not cool :)
 
0
•••
-NB- said:
What about credit to me for coming up with that beautiful AJAX system? Stealing code and claiming as your own is not cool :)

None of my business but if you're going to post in a public forum accusing the OP of stealing code, then would it not be prudent to post some sort of proof? :tu:

Matt
 
0
•••
I posted this before this was posted and it's an AJAX domain checker.

-NB-, I don't think you invented AJAX and it's not the most beautiful thing I've ever seen.
 
0
•••
It does not work in IE 6 and IE 7. Shows javascript error in status bar and script keeps on searching...no results. Please fix it.
 
0
•••
Nice script, but it seems a little buggy at times.
 
0
•••
Yupl, a little buggy. I typed in stargate.com (where I have my server) and got this back:

stargate.com.com is Available
stargate.com.net is Available
stargate.com.org is Available
stargate.com.biz is Available
stargate.com.tv is Available
stargate.com.info is Available
stargate.com.co.uk is Taken
stargate.com.nl is Taken
stargate.com.ca is Taken
stargate.com.name is Taken
stargate.com.ws is Available
stargate.com.be is Taken

First, because com.com is taken, Nothing else under it should be listed as available.

That said, the script should parse input a little better to account for how TLDs are actually used (e.g. .co.uk vs. .com.com sort of thing) and to strip/not strip things as appropriate (also add TLDs if none present).

Other than that, looks nice so far.
 
0
•••
I'll try to fix them up asap.

3l3ctr1c
 
0
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
Appraise.net
Domain Recover
DomainEasy โ€” Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back