JS查询页面是否被百度收录,没有收录则显示搜索链接
作者:互联网
JS查询页面是否被百度收录,没有收录则显示搜索链接
JS查询页面是否被百度收录,没有收录则显示搜索链接
//收录提交代码
var lian = window.location.href;
var lian2 = window.location.href;
var lian = lian.slice(0 , 7);
if (lian != ‘http://’) {
var lian = lian2.slice(8);
}else{
var lian = lian2.slice(7);
}
var lian = ‘http://’ + lian;
setTimeout(function(){
var url = ‘/wp-content/themes/swumoran2.0/sljc.php?un=’ + lian;
$.get(url , function(msg){
if (msg == 2) {
$(‘#tjfcf’).html(‘百度已经收录‘);
return false;
}else{
// tjfcf.innerHTML = “tj($qz,$hz); ttj($qz,$hz); ztj($qz,$hz);”;
//JS域名截取 相当于$qz = $_SERVER[‘HTTP_HOST’];
var llian = window.location.href;
var llian2 = window.location.href;
var llian = llian.slice(0 , 7);
if (llian != ‘http://’) {
var llian = llian2.slice(7,18);
}else{
var llian = llian2.slice(7,17);
}
//js域名截取 相当于$hz = $_SERVER[‘REQUEST_URI’]; .1111.html
var url = window.location.href;
var xinurl = url.slice(0,-5);
var index = xinurl.lastIndexOf(“\/”);
str = xinurl .substring(index + 1, xinurl .length);
str = str + ‘.html’;
str = ‘/’+str;
var url = ‘/wp-content/themes/swumoran2.0/sltj.php?qz=’+llian+ ‘&’ + ‘hz=’ + str;
$.get(url , function(msg){
if(msg == 1){
tjfcf.innerHTML = ‘未收录‘;
}
});
}
})
} , 2000);
标签:slice,url,JS,lian,收录,var,llian,页面 来源: https://blog.csdn.net/muyeseocom/article/details/120284841