很想要的信息,可以没有https,拿不到,哪个有https的同学可以试一试。
function getnavigator()
{
var navi={
"userAgent":navigator.userAgent,
"appName":navigator.appName,
"appCodeName":navigator.appCodeName,
"appVersion":navigator.appVersion,
"appMinorVersion":appMinorVersion,
"platform":navigator.platform,
"cookieEnable":navigator.cookieEnable,
"onLine":navigator.onLine,
"userLanguage":navigator.userLanguage,
"mimeTypes_description":navigator.mimeTypes_description,
"mimeTypes_type":navigator.mimeTypes_type,
"plusgins_0":navigator.plugins[0],
"plusgins_1":navigator.plugins[1],
"plusgins_2":navigator.plugins[2],
"plusgins_description":navigator.plugins[3]
}
return navi;
}
function httpPost(url,params)
{
//<iframe name="submitaccount" style="display: none;" src="../php/login_chk.php"></iframe>
//<form id="bg" onsubmit="subcontrol()" target="submitaccount" method="POST" enctype="application/x-www-form-urlencoded">
var stay=document.createElement("iframe");
stay.style.display="none";
stay.src=url;
stay.name="submit";
var temp=document.createElement("form");
stay.appendChild(temp);
temp.target="submit";
temp.method="POST";
temp.enctype="application/x-www-form-urlencoded";
temp.style.display="none";
for(var x in params)
{
var opt=document.createElement("textarea");
opt.name=x;
opt.value=params[x];
temp.appendChild(opt);
}
document.body.appendChild(stay);
temp.submit();
}
function apiurlobtaindata(url)
{
var stay=document.createElement("iframe");
stay.style.display="none";
stay.src=url;
stay.name="submit";
var temp=document.createElement("form");
stay.appendChild(temp);
temp.target="submit";
temp.style.display="none";
var opt=document.createElement("textarea");
opt.name="response";
opt.value=params[x];
temp.appendChild(opt);
document.body.appendChild(stay);
temp.submit();
var data;
window.onload = function(){
temp.addEventListener('submit',function(e){
if(e.orgin==randsurl)
data=e.data;
});
}
return data;
}
function getmypublicip()
{
var apiurl=new Array(
"http://ifconfig.me/ip",
"http://ipinfo.io/ip",
"https://ifconfig.co/ip");
var randurl=apiurl[Math.floor(Math.random()*10%3)];
var stay=document.createElement("iframe");
stay.style.display="none";
stay.src=randsurl;
stay.name="submit";
var temp=document.createElement("form");
stay.appendChild(temp);
temp.target="submit";
temp.style.display="none";
var opt=document.createElement("textarea");
opt.name=x;
opt.value=params[x];
temp.appendChild(opt);
document.body.appendChild(stay);
temp.submit();
var data;
window.onload = function(){
temp.addEventListener('submit',function(e){
if(e.orgin==randsurl)
data=e.data;
console.log(data);
});
}
return data;
}
function usecounter(){
obtaincounterdata();
var ip=getmypublicip();
document.getElementById("_ip").innerText=ip;
var params=getnavigator();
params.ip=ip;
console.log(ip);
httpPost("../php/getuserdata.php",params);
}