摘要:
location对象表示窗口中的URL,并有诸多属性帮助我们解析URL。 属性 host:服务器的名字(如:www.baidu.com); hostname:一般与host的值一样,也可能去掉前面的'www.'; pathname:主机后面的路径。如连接www.baidu.com/aaa/bbb.html的pathname为/aaa/bbb.html; href:完整的URL; port:端口号。URL中的端口号:如:www.localhost:8080的port为8080; protocol:协议名。如:http:、ftp:;URl中'//'之前的内容。... 阅读全文
posted @ 2013-05-14 10:42
依伦
阅读(201)
评论(0)
推荐(0)
摘要:
js对象继承方式不止一种,而且是模仿实现的继承。 1、对象冒充方式: 例子: function ClassA(color){ this.color = color; this.showColor = function(){ alert(this.color); } } function ClassB(color,name){ this.method = ClassA; //将ClassB的对象的method属性指向ClassA函数,这里把ClassA当作一个函数。 thi... 阅读全文
posted @ 2013-05-14 09:32
依伦
阅读(376)
评论(0)
推荐(0)
浙公网安备 33010602011771号