JavaScript

放一些工作會用到的 JavaScript

偵測client 連線的是 HTTP or HTTPS 及 IE only

<script language="javascript" type="text/javascript">
	var url=window.location.toString();
	if(document.location.protocol=='https:'){
		document.write ('<META HTTP-EQUIV="refresh" CONTENT="0;URL=http://choice.au.edu.tw/choice">');
	}else{
		var A = (navigator.appVersion.indexOf("MSIE 9.0") != -1) ? true : false;
		var B = (function x(){})[-5]=='x'?'FF3':(function x(){})[-6]=='x'?'FF2':/a/[-1]=='a'?'FF':'\v'=='v'?'IE':A?'IE9':/a/.__proto__=='//'?'Saf':/s/.test(/a/.toString)?'Chr':/^function \(/.test([].sort)?'Op':'Unknown';
		if(B != "IE" && B != "IE9"){
			window.alert("請使用 Internet Explorer 瀏覽器操作本系統!");
			document.write("<br><br><br><br><br><center><B>請使用 Internet Explorer 瀏覽器操作本系統!<br><br>下列為錯誤回報內容:<br>" + navigator.appVersion + "<br>" + navigator.userAgent);
		}
	}
</script>
javascript.txt · 上一次變更: 2012/07/06 05:25 由 jal
上一頁 | 下一頁 | 回首頁 | RSS Feed | Facebook