流行的网页制作技术
wampserver的虚拟机
ASP .asp
PHP .php
.NET .aspx 优快云
JavaScript 中创建对象的方法
var star = new Object;
var star = {};
为对象添加属性
直接分配属性
star.name = "Polaris";
star.consetllation = "Ursa Minor";
遍历对象属性
for(var element in star){
for(var propt in star[element]){
alert(element = ":" + propt + " = " + star[element][propt]);
}
}
查找属性
if(property in object){
//
}
为对象添加方法
function star(constell,type,specclass,magnitude){
this.constellation = constell;
this.type = type;
this.spectralClass = specclass;
this.mag = magnitude;
this.show = function(){
alert("Hello,this is the method!");
}
}
JavaScript中的数组操作方法
join()方法和contat()方法
contat();//在最后添加元素
join(); //将所有的元素转化为一个连接字符串
push()和pop()方法增加和删除元素
pop();//在数组的结束进行删除操作
push();//在数组的结束进行增加操作
shift()方法和unshift()方法增加和删除元素
shift(); //在开始的时候为数组增加一个元素
unshift(); //在开始的时候为数组删除一个元素
slice()方法返回数组的一部分
实质上是对数组元素的提取,并不会改变原来数组元素的值
slice(2,4); //截取数组中的第二个到第四个元素