<html>
<head>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="layer.min.js"></script>
<script>
var html=‘<div class>用户名:<input /><br>密码:<input /></div>‘;
var obj= {check:function(options){
$.post(options.url2,function(data){
if(data == ‘no‘){
layer.alert(‘您没有登录系统,请登录!‘, 8, function(){
layer.close(layer.index);
$.layer({
type: 1,
title: false, //不显示默认标题栏
shade: [0], //不显示遮罩
area: [‘600px‘, ‘360px‘],
offset:[‘100px‘, ‘100px‘],
page: {html:html}
});
});
}
},‘text‘);
}};
$(document).ready(function(){
$(‘#test9‘).on(‘click‘, function(){
obj.check({url2:‘http://localhost/test/check.php‘});
});
})
</script>
</head>
<body>
<button id="test9">999</button>
</body>
</html>