Html程序  |  33行  |  627 B

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Popup Status</title>
<id>
<script type="text/javascript">
var pageReady = false;

function onLoad() {
  pageReady = true;
  isPopupBlocked();
}

function isPopupBlocked() {
  var popup_window = window.open(null, "", "width=100,height=100");
  try {
    popup_window.close();
    document.getElementById('status').innerHTML += 'Allowed.';
    return false;
  }
  catch (e) {
    document.getElementById('status').innerHTML += 'Blocked.';
    return true;
  }
}
</script>
</head>
<body onload="onLoad()">
<div id=status>Pop-ups Status: </div>
</body>
</html>