//if(self!=top){top.location=self.location;}
var url ='.';
var action = new Array();

action['root'] = url+'/action/root.php';
action['pagerank'] = url+'/action/pagerank.php';
action['engine_record'] = url+'/action/engine_record.php';
action['whois'] = url+'/action/whois.php';
action['alexa'] = url+'/action/alexa.php';
action['ip'] = url+'/action/ip.php';
action['engine_keyword'] = url+'/action/engine_keyword.php';
action['engine_link'] = url+'/action/engine_link.php';
action['density'] = url+'/action/density.php';
action['special_htmlchar'] = url+'/action/special_htmlchar.php';
action['source'] = url+'/action/source.php';
action['rate'] = url+'/action/rate.php';
action['express_cost'] = url+'/action/express_cost.php';
action['links'] = url+'/action/links.php';
action['mobile'] = url+'/action/mobile.php';
action['postalcode'] = url+'/action/postalcode.php';
action['wubi'] = url+'/action/wubi.php';
action['alexa_contrast'] = url+'/action/alexa_contrast.php';

//ajax请求时间限制
var timeout = 10000;

String.prototype.is_domain = function(){

//出除两边空格
var _this = this.replace(/(^\s*)|(\s*$)/g,'').toLowerCase();

//是否输入“http://”?
var regular = /[a-zA-z]+:\/\/(.*)/;

if(!regular.test(_this)){ _this = 'http://'+_this; }

regular = /\b((https?|ftp):\/\/[-a-z0-9]+(\.[-a-z0-9]+)*\.(?:com|edu|gov|int|mil|net|org|biz|info|name|museum|coop|aero|[a-z][a-z]|((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]\d)|\d))\b(\/[-a-z0-9_:\@&?=+,.!/~%\$]*)?)/;

if (regular.test(_this)){

return _this;

}else{

alert('请输入正确的域名!');

return false;

}

}

String.prototype.trim = function(){
return this.replace(/(^\s*)|(\s*$)/g,'');
}


function suburl(url){

var reg = /<>\"\'/g;

url = url.trim();

url = url.replace(reg,"");

var regex = /.*\:\/\/([^\/]*).*/;

var match = url.match(regex);

if(typeof match != "undefined" && null != match){

return match[1];

}
}



function is_ip(){

var _ip = document.getElementById('domain').value;

var exp=/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;
var reg = _ip.match(exp);
if(reg==null){
return false;
}
else
{
return _ip;
}
}



// pagerank 查询
function get_pagerank(){
var domain = $('#domain').val().is_domain();
if(domain){
$("#pagerank").ajaxStart(function(){$(this).html('<div class="loading">正在加载...</div>')})
$.ajax({
type: "post",
cache:false,
url: action['pagerank'],
data: "action=pagerank&domain="+domain,
timeout:timeout,
success: function(data){
$('#copyvalue').val($('#thisurl').val()+'?domain='+domain.replace(/^http:\/\//,''));
$('#copyblock').show();
$('#pagerank').html(data);
},
error: function(){
$('#pagerank').html('服务器繁忙,请稍后再试!');
}
});
}
}








// 全选/反选
function select_all(object) {

var e = object.form.elements;

for (var i = 0; i < object.form.elements.length; i++) {

if (e[i].name != object.name && e[i].type == 'checkbox' ){

e[i].checked = object.checked;

}

}

}

// whois
function get_whois(){

var domain = $('#domain').val().is_domain();

if(!domain){

return false;

}

$("#whois").ajaxStart(function(){$(this).html('<div class="loading">正在加载...</div>')});

$.ajax({
type: "post",
cache:false,
url: action['whois'],
data: "action=whois&domain="+domain,
timeout:timeout,
success: function(data){
$('#copyvalue').val($('#thisurl').val()+'?domain='+domain.replace(/^http:\/\//,''));
$('#copyblock').show();
$('#whois').html(data);
},
error: function(){
$('#whois').html('服务器繁忙,请稍后再试!');
}
});

}


//aleax
function get_alexa(_domain){

if(!_domain){

_domain = $('#domain').val().is_domain();

}

if(_domain){

$("#alexa").ajaxStart(function(){$(this).html('<div class="loading">正在加载...</div>')})

$.ajax({
type: "post",
cache:false,
url: action['alexa'],
data: "action=alexa&domain="+_domain,
timeout:timeout,
success: function(data){
$('#copyvalue').val($('#thisurl').val()+'?domain='+_domain.replace(/^http:\/\//,''));
$('#copyblock').show();
$('#alexa').html(data);
},
error: function(){
$('#alexa').html('服务器繁忙,请稍后再试!');
}
});

}

return false;
}


function get_alexa_contrast(_domain){



if(!_domain){

_domain = $('#domain').val();

}


if(_domain){

$("#alexa").ajaxStart(function(){$(this).html('<div class="loading">正在加载...</div>')})

$.ajax({
type: "post",
cache:false,
url: action['alexa_contrast'],
data: "action=alexa_contrast&domain="+_domain,
timeout:timeout,
success: function(data){
$('#copyvalue').val($('#thisurl').val()+'?domain='+_domain.replace(/^http:\/\//,''));
$('#copyblock').show();
$('#alexa').html(data);
},
error: function(){
$('#alexa').html('服务器繁忙,请稍后再试!');
}
});

}

return false;


}



//aleax
function get_ip(){

var domain = $('#domain').val().is_domain();

if(!domain){

return false;

}

domain = suburl(domain);



$("#ip").ajaxStart(function(){$(this).html('<div class="loading">正在加载...</div>')})

$.ajax({
type: "post",
cache:false,
url: action['ip'],
data: "action=ip&domain="+domain,
timeout:timeout,
success: function(data){
$('#copyvalue').val($('#thisurl').val()+'?domain='+domain.replace(/^http:\/\//,''));
$('#copyblock').show();
$('#ip').html(data);
},
error: function(){
$('#ip').html('服务器繁忙,请稍后再试!');
}
});

}


// get_source 获取原代码
function get_source(){
var domain = $('#url').val().is_domain();
if(domain){
$("#html_source1").ajaxStart(function(){$(this).html('<div class="loading">正在加载...</div>')})
$.ajax({
type: "post",
cache:false,
url: action['source'],
data: "action=get_source&url="+domain,
timeout:timeout,
success: function(data){

$('#copybutton').show();
$('#html_source1').val(data);
},

Next
Pg.: 1 2 3 4


Back to home | File page

Subscribe | Register | Login | N