发布于 2016-09-30 00:48:29 | 147 次阅读 | 评论: 0 | 来源: 网友投递
这里有新鲜出炉的Javascript教程,程序狗速度看过来!
JavaScript客户端脚本语言
Javascript 是一种由Netscape的LiveScript发展而来的原型化继承的基于对象的动态类型的区分大小写的客户端脚本语言,主要目的是为了解决服务器端语言,比如Perl,遗留的速度问题,为客户提供更流畅的浏览效果。
apple.banana.candy.dog.egg.fog.god.huh.index = 0;
doSomething(apple.banana.candy.dog.egg.fog.god.huh.index);
with(apple.banana.candy.dog.egg.fog.god.huh) {
c = 0;
doSomething(index);
}
var root = {
branch: {
node: 1
}
};
with(root.branch) {
node = 0;
// 显示 0, 正确!
alert(node);
}
// 显示 0, 正确!
alert(root.branch.node);
var root = {
branch: {
node: 1
}
};
with(root.branch) {
root.branch.node = 0;
// 显示 0, 正确!
alert(node);
}
// 显示 0, 正确!
alert(root.branch.node);
var root = {
branch: {
node: 1
}
};
with(root.branch) {
root.branch = {
node: 0
};
// 显示 1, 错误!
alert(node);
}
// 显示 0, 正确!
alert(root.branch.node);
var root = {
branch: {
node: 1
}
};
var quote = root.branch;
quote.node = 0;
// 显示 0, 正确!
alert(root.branch.node);