我不知道为什么当我在html中添加js时弹出窗口不能自动弹出,js会检查数据以获取“错误”/“过期”并会弹出全屏消息,任何人都可以帮忙吗?
这是弹出js:
(function ($) {
$(function () {
$.get("http://www.theonionism.com/webcontrol/check.php?client=www.theonionism.com", function(data){
console.log(data);
if(data == "error"){
alert("Web site error, please contact us");
return false;
}
if(data == "expired"){
$("body").append('<div class="expried-background"></div><div class="expried-nav">Website already expired, please contact us to resolve the matter.</div>');
$("body").css("margin", "0px");
$(".expried-background").css({
"position":"absolute",
"top":"0px",
"left":"0px",
"background-color":"black",
"opacity": "0.8",
"z-index": "99999",
"width": $(document).width(),
"height": $(document).height()
});
$(".expried-nav").css({
"position":"absolute",
"top": "45%",
"height":"40px",
"width":"100%",
"background-color":"#fff",
"z-index": "999999",
"font-family":"Arial",
"font-weight":"bold",
"text-align":"center",
"color":"red",
"padding-top":"20px",
});
return false;
}
});
});
})(jQuery);