By admin on 2012年01月8日
Javascript是一个类C的语言,他的面向对象的东西相对于C++/Java比较奇怪,但是其的确相当的强大,在 Todd 同学的“对象的消息模型”一文中我们已经可以看到一些端倪了。这两天有个前同事总在问我Javascript面向对象的东西,所以,索性写篇文章让他看去吧,这里这篇文章主要想从一个整体的解度来说明一下Javascript的面向对象的编程。(成文比较仓促,应该有不准确或是有误的地方,请大家批评指正)
初探
我们知道Javascript中的变量定义基本如下:
var name = 'Chen Hao';;
var email = 'haoel(@)hotmail.com';
var website = 'http://coolshell.cn';
如果要用对象来写的话,就是下面这个样子:
var chenhao = {
name :'Chen Hao',
email : 'haoel(@)hotmail.com',
website : 'http://coolshell.cn'
};
于是,我就可以这样访问:
//以成员的方式
chenhao.name;
chenhao.email;
chenhao.website;
//以hash map的方式
chenhao["name"];
chenhao["email"];
chenhao["website"];
关于函数,我们知道Javascript的函数是这样的:
var doSomething = function(){
alert('Hello World.');
};
于是,我们可以这么干:
var sayHello = function(){
var hello = "Hello, I'm "+ this.name
+ ", my email is: " + this.email
+ ", my website is: " + this.website;
alert(hello);
};
//直接赋值,这里很像C/C++的函数指针
chenhao.Hello = sayHello;
chenhao.Hello();
相信这些东西都比较简单,大家都明白了。 可以看到javascript对象函数是直接声明,直接赋值,直接就用了。runtime的动态语言。 Continue reading “Javascript 面向对象编程”
Posted in 编程其他 | Tagged javascript |
By admin on 2012年01月6日
雨林木风 Ghost XP SP3装机版 YN9.9
ghost XP3 YN9.9 CN更新版下载:
QQ旋风离线1:qqdl://RnRwOi8vMTE2OjExNkA2MS4xNDUuNjIuOTgv0+rB1sS+t+cgR2hvc3QgWFAgU1AzINewu/qw5iBZTjkuOV9CWV9DTi5pc28=
QQ旋风离线2:qqdl://RnRwOi8vMTE1OjExNUA2MS4xNDUuNjIuMTE1L9PqwdbEvrfnIEdob3N0IFhQIFNQMyDXsLv6sOYgWU45LjlfQllfQ04uaXNv
迅雷下载1:thunder://QUFGdHA6Ly8xMTY6MTE2QDYxLjE0NS42Mi45OC/T6sHWxL635yBHaG9zdCBYUCBTUDMg17C7+rDmIFlOOS45X0JZX0NOLmlzb1pa
迅雷下载2:thunder://QUFGdHA6Ly8xMTU6MTE1QDYxLjE0NS42Mi4xMTUv0+rB1sS+t+cgR2hvc3QgWFAgU1AzINewu/qw5iBZTjkuOV9CWV9DTi5pc29aWg==
原版:thunder://QUFGdHA6Ly8xMTU6MTE1QDYxLjE0NS42Mi4xMTUv0+rB1sS+t+cgR2hvc3QgWFAgU1AzINewu/qw5iBZTjkuOS5pc29aWg==
YlmF_XP3_YN9.9.iso (694.7 MB)
雨林木风 WinXP SP3安装版 YS8.0
YlmF_XPSP3_YS8.0F.iso (678.57 MB)
雨林木风 Ghost XP SP3纯净版 Y6.0
YlmF_GhostXP_SP3_Y6.0.iso (693.81 MB)
Windows Vista ULTIMATE SP1精简版V2.1
YlmF_Vista_Lite_2.1.iso (2.66 GB) Continue reading “雨林木风官方所有系统下载连接”
Posted in 电脑网络 |
By admin on 2012年01月3日
The topLink jQuery plugin developed by David Walsh, allows you to fade in a “to the top” link when the users scrolls down on the page.

This tutorial will help you build a scroll to top link, that appears when the user scrolls down, and disappears when users reach the top of the page using a combination of CSS and jQuery. Continue reading “7 ‘Scroll to Top’ jQuery Solutions”
Posted in 编程其他 | Tagged javascript, javascript技巧, jquery |
By admin on 2011年12月19日
Posted in 编程其他 | Tagged skydrive |
By admin on 2011年12月11日
官方网站:http://www.contao.org/
演示地址:http://demo.contao.org/contao/
下载地址:http://www.contao.org/download.html
文章来源:http://www.OSphp.com.cn
程序介绍:
Contao 是一个采用 PHP 开发的 CMS 建站系统,具备非常高的安全性和良好的搜索;可方便设置用户权限、在线更新服务和先进的CSS框架以及例如日历、新闻和表单等基层模块;曾用名:Typolight。

Contao is an open source content management system (CMS) for people who want a professional internet presence that is easy to maintain. The state-of-the-art structure of the system offers a high security standard and allows you to develop search engine friendly websites that are also accessible for people with disabilities. Furthermore, the system can be expanded flexibly and inexpensively. Easy management of user rights, the Live Update Service, the modern CSS framework and many already integrated modules (news, calendar, forms, etc.) have quickly made Contao one of the most popular open source content management systems on the market.
Posted in 开源代码 | Tagged cms, php |
By admin on 2011年11月27日
这几天Justhost官方系统正在调整,今天无意中测试下半价优惠码还好不好用的时候,竟然发现个问题。输入JH主机半价优惠码后,发现年付方案并没有优惠,一年需要59.4美金,而不是41.88美金。但是2年主机方案只需要59.52美金,后者超级划算。

JustHost主机官方网站:JustHost.com

Posted in 未分类 |
By admin on 2011年11月4日
1. Nivo Slider
Nivo Slider是世界知名的轻量级jQuery图片幻灯片插件,可以制作出很漂亮的效果。它完全免费且彻底开源。

2. Sponsor Flip Wall With jQuery & CSS
Sponsor Flip Wall是一个非常不错的显示数据到网格里的插件,它使用PHP、CSS与jQuery翻转插件制作而成,其实就是为了创建一个翻转赞助商页面。可以用来展示你的客户或生成一个整洁的翻转动画组合项目。 Continue reading “8个图片展示jQuery插件及教程”
Posted in 编程其他 | Tagged javascript, jquery |
By admin on 2011年10月22日
In many situations web designers should avoid Flash and prefer usual text-based presentation. For instance, in most tasks related to pure text presentation Flash is neither necessary nor user-friendly, and it also has some serious accessibility problems: in fact, “pure” text is easier to maintain and easier to copy and paste.
However, if you’d like to present some multimedia-content, particularly images, Flash can often be a feasible solution, with flexible image management for web designers and impressive visual presentation for users. Used moderately, Flash-based galleries can give the presentation a fresh spark and create a rich visual experience you might want to offer your visitors.
In this post we present some of the free, attractive and flexible Flash-based galleries you can use to present your images more effectively. You might find some useful references to further galleries in our article 30 Best Solutions For Image Galleries, Slideshows and Lightboxes.
[
Editor's note: Have you already got your copy of the
Smashing Book #2? The book shares valuable practical insight into design, usability and coding.
Have a look at the contents.]
Flash-based Galleries: An Overview
Polaroid Gallery offers a quite unusual way of presenting a bunch of photos online. The script loads images and image titles dynamically from an external XML file. Then the script processes the data and creates an interactive flash gallery in which all images are presented as Polaroid-photos.
The images are kind of thrown on the the table randomly and create a beautiful mess — the idea resembles BumpTop, physics-driven 3D-desktop with draggable folders and files. You can move the polaroids around with the mouse, and you can double click a Polaroid picture to zoom in. Continue reading “Flash-Based Galleries For Your Images”
Posted in 网站建设 |
By admin on 2011年10月15日
Posted in 编程其他 |
By admin on 2011年10月13日
本文向你介绍 7 款很漂亮的相片展示的 jQuery 插件,提供在线演示和免费下载。
1. 交互式相片桌面,使用 jQuery 和 CSS3 开发
Demo Download
Continue reading “7 个漂亮的 jQuery 照片插件”
Posted in 编程其他 | Tagged java, javascript, jquery |