Первый вариант запахал если dojo выкинуть и заменить на document
и добавил random
<html>
<head>
<script>
mike="offline";
function attachScript(id, src){
var element = document.createElement("script")
element.type = "text/javascript";
element.src = src;
element.id = id;
document.getElementsByTagName("head")[0].appendChild(element)
}
attachScript('script1','http://94.233.4.22/testonline.js?date='+Math.random());
function $(id) { return document.getElementById(id);}
window.onload = function()
{
$("ch").style.display="none";
$("bn").style.display="none";
$("bt").style.display="none";
if(mike=='online') {alert("online");window.location.href = "http://94.233.4.22";}
else {alert("offline");window.location.href = "index.htm";}
}
</script>
</head>
<body>
</body>
</html>