網頁文章 javax.portlet.title.56

網頁文章 javax.portlet.title.56

Navigator物件屬性

 

 

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Ch10_3_2.htm</title>
</head>
<body>
<h2>Navigator物件屬性</h2>
<hr>
<script>
var objnav = window.navigator;
document.write("appCodeName= " + objnav.appCodeName + "<br/>");
document.write("appMinorVersion= " + objnav.appMinorVersion + "<br/>");
document.write("appName= " + objnav.appName + "<br/>");
document.write("appVersion= " + objnav.appVersion + "<br/>");
document.write("browserLanguage= " + objnav.browserLanguage + "<br/>");
document.write("cookieEnabled= " + objnav.cookieEnabled + "<br/>");
document.write("cpuClass= " + objnav.cpuClass + "<br/>");
document.write("onLine= " + objnav.onLine + "<br/>");
document.write("platform= " + objnav.platform + "<br/>");
document.write("systemLanguage= " + objnav.systemLanguage + "<br/>");
document.write("userAgent= " + objnav.userAgent + "<br/>");
document.write("userLanguage= " + objnav.userLanguage + "<br/>");
</script>
</body>
</html>
網頁文章 javax.portlet.title.56

History物件屬性

 

 

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Ch10_4_1.htm</title>
</head>
<body>
<h2>History物件</h2>
<hr/>
<script>
var objhis = window.history;
document.write("歷史記錄數= " + objhis.length + "<br/>");
</script>
<form>
<input type="button" value="上一頁" onclick="history.back();">
<input type="button" value="下一頁" onclick="history.forward();">
</form>
</body>
</html>

 

網頁文章 javax.portlet.title.56

Location物件屬性

 

  

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Ch10_4_2.htm</title>
<script>
// 改變URL網址
function changeURL(strurl){
   window.location.href = strurl;
}
</script>
</head>
<body>
<h2>Location物件</h2>
<hr/>
<form>
<input type="button" value="變更URL" onclick="changeURL('http://127.0.0.1:4001/Ch10/Ch10_4_1.htm');">
<input type="button" value="重新載入" onclick="location.reload();">
<input type="button" value="取代URL" onclick="location.replace('http://127.0.0.1:4001/Ch10/Ch10_4_1.htm');">
</form>
<script>
var objloc;
for (objloc in location) {
   document.write(objloc + " : " + location[objloc] + "<br/>");
}
</script>
</body>
</html> 

 

 

 

 

 

 

 

網頁文章 javax.portlet.title.56

Screen物件的屬性

 

  

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Ch10_3_1.htm</title>
</head>
<body>
<h2>Screen物件的屬性</h2>
<hr/>
<script>
document.write("螢幕解析度: ");
document.write(screen.width + " X ");
document.write(screen.height + "<br/>");
document.write("螢幕視野: ");
document.write(screen.availWidth + " X ");
document.write(screen.availHeight + "<br/>");
document.write("色彩數: " + screen.colorDepth + "<br/>");
</script>
</body>
</html>