jquery 彈出層ajax登陸執行個體代碼
jQuery(document).ready(function(){
jQuery('.login_show').click(function(){
var xmlhttp=createxmlhttp();
if(!xmlhttp)
{
alert("你的瀏覽器不支援XMLHTTP!!");
return;
}
var Digital=new Date();
Digital=Digital+40000;
if(window.location.href.toLowerCase().indexOf("learn/")==-1)
{
url="/request.asp教程x?action=checklogin&k="+Digital;
}
else{
url=nowdomain+"request.aspx?action=checklogin&k="+Digital;
}
xmlhttp.onreadystatechange=requestdatalogincheck;
//window.open(url);
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
function requestdatalogincheck()
{
if(xmlhttp.readyState==4)
{
if(xmlhttp.status==200)
{
if(xmlhttp.responseText=="1"){
jQuery('#login_node').addClass('display');
}
else{
alert("您已經是登陸狀態,如果需要更換帳號登陸請先退出!");
}
}
}
}
});
jQuery('input#l_cancel').click(function(){
jQuery('#login_node').removeClass('display');
});
});