selv om points er givet så vil jeg da alligevel poste det endelige resultat
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="
http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="javascript1.5" type="text/javascript">
function isXpSP2()
{
var result = (window.navigator.userAgent.indexOf("SV1") != -1);
if (result)
{
//This browser is Internet Explorer in SP2.
return true;
}
else
{
//This browser is not Internet Explorer in SP2.
return false;
}
}
function isXP(){
var result = window.navigator.userAgent.indexOf("Windows NT 5.1") != -1;
if (result){
return true;
} else {
return false;
}
}
function isIE(){
var myBrowser = navigator.appName;
if (myBrowser == "Microsoft Internet Explorer"){
return true;
} else {
return false;
}
}
function displaySPresult(result){
var result;
var td_cell = document.getElementById('popup-result');
var div_content = document.getElementById('popup-result-div');
if (result=='blocked'){
if (isXP() && isXpSP2()){
div_content.innerHTML = "Your pop-up blocker is enabled - please allow set it to allow pop-ups from
http://127.0.0.1/"; div_content.innerHTML += "<p>click here for a quick guide for Windows XP running Service Pack 2</p>";
td_cell.bgColor = "#FF0000";
} else if(isIE()){
div_content.innerHTML = "Your pop-up blocker is enabled - please allow set it to allow pop-ups from
http://127.0.0.1/"; td_cell.bgColor = "#FF0000";
} else {
div_content.innerHTML = "Your pop-up blocker is enabled - please allow set it to allow pop-ups from
http://127.0.0.1/"; div_content.innerHTML += "<p>It also appears thet you are using a browser not supportet by the Aplication. Please Use Microsoft Internet Explorer.</p>";
td_cell.bgColor = "#FF0000";
}
}
if (result == "ok") {
if (isIE()){
div_content.innerHTML="Your browser is ready for
http://127.0.0.1/"; td_cell.bgColor = "#00FF00";
} else {
div_content.innerHTML="Your browser allows pop-ups, but in order for the Aplication to work you have to use Microsoft Internet Explorer";
td_cell.bgColor = "#FFFF33";
}
}
}
function tryPopUp(){
try {
newwindow2=window.open('','popup','height=200,width=150');
var tmp = newwindow2.document;
tmp.write('<html><head><title>POP-UP test</title>');
tmp.write('</head><body><p>This is a test to verify that you have enabled popups</p>');
tmp.write('<p><input type="button" value="close" onClick="self.close();" </p>');
tmp.write('</body></html>');
displaySPresult('ok');
}
catch (e) {
displaySPresult('blocked');
}
}
</script>
</head>
<body onload="tryPopUp();">
<p> </p>
<table width="500" border="0" cellspacing="2" cellpadding="0">
<tr valign="top">
<td width="102">Test Result:</td>
<td width="392" bgcolor="#FFFFFF" id="popup-result" style="padding:3px; "><div id="popup-result-div"> </div></td>
</tr>
</table>
<p> </p>
</body>
</html>