发布于 2016-09-08 00:15:07 | 94 次阅读 | 评论: 0 | 来源: 网友投递
这里有新鲜出炉的Javascript教程,程序狗速度看过来!
JavaScript客户端脚本语言
Javascript 是一种由Netscape的LiveScript发展而来的原型化继承的基于对象的动态类型的区分大小写的客户端脚本语言,主要目的是为了解决服务器端语言,比如Perl,遗留的速度问题,为客户提供更流畅的浏览效果。
function test(x)
{
alert(x);
}
test("hello");
(test)("hello");
//等同于下面的代码
(function test(x)
{
alert(x);
})("hello");
//也等同于下面的代码
(function (x)
{
alert(x);
})("hello");
function test(x)
{
alert("定义一个标识函数");
}
var test = function()
{
alert("将一个匿名函数指向一个引用");
}
(function()
{
alert("我是一个匿名函数");
})();//这里其实已经定义并执行了一个匿名函数
function test(func)
{
alert(func);
}
test((function(){return "匿名函数(的执行结果)作为参数"})());