window, screen , document 关系


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

?window是JavaScript中最大的对象,它描述的是一个浏览器窗口。
window 包括screen,document, location …
screen 屏幕对象 反映了当前用户的屏幕设置。
document 文档对象 描述当前窗口或指定窗口对象的文档。
location 对象,连接
location对象? ?

  • href 整个URL字符串.
  • protocol 含有URL第一部分的字符串,如http:
  • host 包含有URL中主机名:端口号部分的字符串.如//www.cenpok.net/server/
  • hostname 包含URL中主机名的字符串.如http://www.cenpok.net
  • port 包含URL中可能存在的端口号字符串.
  • pathname URL中”/”以后的部分.如~list/index.htm
  • hash “#”号(CGI参数)之后的字符串.
  • search “?”号(CGI参数)之后的字符串. //得到URL传来的参数

function getUrlPara(paraName){?

var URLParams = new Object();
var aParams = document.location.search.substr(1).split(“&”);
if ( aParams == “” || aParams == undefined ){
??? return 0;
}
for (i=0; i<aParams.length; i++)
{
???? var aParam = aParams[i].split(“=”);
???? URLParams[aParam[0]] = aParam[1];
}
? return URLParams[paraName];

}