2013年1月11日
摘要: 1.http://mattkersley.com/responsive/支持JS.2.http://www.benjaminkeen.com/open-source-projects/smaller-projects/responsive-design-bookmarklet/支持自定义尺寸,可以保存为书签,在任意页面点击该书签即可以测试当前页面.3.http://www.responsinator.com/界面更形象以上均可测试本地页面.(http://localhost/)最后推荐文章一篇:自适应网页设计(Responsive Web Design) 阅读全文
posted @ 2013-01-11 09:47 Cloud Lee 阅读(3088) 评论(4) 推荐(7) 编辑
  2012年12月27日
摘要: 1 //类定义(prototype 模式) 2 function Cat(name,color) { 3 this.name = name; 4 this.color = color; 5 } 6 Cat.prototype.type = 'cat'; 7 Cat.prototype.food = 'fish'; 8 Cat.prototype.eat = function() { 9 alert(this.name + ' is eating '+this.food);10 };11 12 //使用13 var cat1 = new Cat(& 阅读全文
posted @ 2012-12-27 11:58 Cloud Lee 阅读(376) 评论(11) 推荐(2) 编辑
  2012年11月26日
摘要: 1.将程序内部时区设置为UTC时间.(UTC 也可以叫 GMT)PHP设置:date_default_timezone_set("UTC");Yii设置:config/main.php 中添加 :'timeZone'=>'UTC',如此设置后,PHP生成的时间基本都是UTC时间了.例如://输出当前UTC时间date("Y-m-d H:i:s");2.数据库中存储UTC时间.可以用PHP控制,也可以通过设置数据库时区来实现.3.服务端发送到前端的时间均为UTC时间格式, 由JS将其转换为本地时间后进行显示.JS内部数 阅读全文
posted @ 2012-11-26 17:42 Cloud Lee 阅读(581) 评论(0) 推荐(1) 编辑
  2012年11月19日
摘要: 安装后,打开http://localhost:10081/ZendServer出现如下页面.Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request.Please contact the server administrator, admin@example.com and inform them of the time the error occurred, and anything you might ha 阅读全文
posted @ 2012-11-19 15:46 Cloud Lee 阅读(222) 评论(0) 推荐(1) 编辑
  2012年11月17日
摘要: 1.下载官网地址:http://www.phpmyadmin.net2.安装解压至服务器根目录(如www,webroot),文件夹改名为phpMyAdmin,然后可以通过http://localhost/phpMyAdmin 之类的路径访问.3.配置1)将phpMyAdmin/config.sample.inc.php 改名为config.inc.php.2)参考文件phpMyAdmin/libraries/config.default.php ,更改1)中改名后的config.inc.php 文件.配置举例:$cfg['Servers'][$i]['host' 阅读全文
posted @ 2012-11-17 12:33 Cloud Lee 阅读(239) 评论(0) 推荐(1) 编辑
  2012年10月17日
摘要: header()函数的作用是:发送一个原始 HTTP 标头[Http Header]到客户端。标头 (header) 是服务器以 HTTP 协义传 HTML 资料到浏览器前所送出的字串,在标头 与 HTML 文件之间尚需空一行分隔。有关 HTTP 的详细说明,可以参 RFC 2068 官方文件 (http://www.w3.org/Protocols/rfc2068/rfc2068)。在 PHP 中送回 HTML 资料前,需先 传完所有的标头。使用范例 范例一: 本例使浏览器重定向到 PHP 的官方网站。 <?PHPHeader("Location: http://www.ph 阅读全文
posted @ 2012-10-17 11:43 Cloud Lee 阅读(3547) 评论(0) 推荐(2) 编辑
  2012年9月19日
摘要: 1 function notify() { 2 if (window.webkitNotifications) { //判断是否支持该功能 3 if (window.webkitNotifications.checkPermission() == 0) { //判断是否允许弹出桌面通知 4 //文本模式创建通知 5 var deskBox = window.webkitNotifications.createNotification('image.png', '标题', '内容'); 6 ... 阅读全文
posted @ 2012-09-19 17:43 Cloud Lee 阅读(2102) 评论(0) 推荐(1) 编辑
  2012年7月15日
摘要: mysql存储过程详解1. 存储过程简介我们常用的操作数据库语言SQL语句在执行的时候需要要先编译,然后执行,而存储过程(Stored Procedure)是一组为了完成特定功能的SQL语句集,经编译后存储在数据库中,用户通过指定存储过程的名字并给定参数(如果该存储过程带有参数)来调用执行它。一个存储过程是一个可编程的函数,它在数据库中创建并保存。它可以有SQL语句和一些特殊的控制结构组成。当希望在不同的应用程序或平台上执行相同的函数,或者封装特定功能时,存储过程是非常有用的。数据库中的存储过程可以看做是对编程中面向对象方法的模拟。它允许控制数据的访问方式。存储过程通常有以下优点:(1).存储 阅读全文
posted @ 2012-07-15 23:25 Cloud Lee 阅读(613) 评论(0) 推荐(1) 编辑
摘要: 极简主义法 荷兰程序员 Gabor de Mooij 提出了一种比 Object.create ()更好的新方法,他称这种方法为"极简主义法"(minimalist approach)。这也是我推荐的方法。 3. 1 封装 这种方法不使用 this 和 prototype,代码部署起来非常简单,这大概也是它被叫做"极简主义法"的原因。 首先,它也是用一个对象模拟"类"。在这个类里面,定义一个构造函数 createNew (),用来生成实例。var Cat = {createNew: function (){// some code h 阅读全文
posted @ 2012-07-15 23:24 Cloud Lee 阅读(1235) 评论(7) 推荐(4) 编辑
摘要: 1.定义类(对象模版)动态原型方法示例:function Car(sColor,iDoors,iMpg) { this.color = sColor; this.doors = iDoors; this.mpg = iMpg; this.drivers = new Array("Mike","John"); if (typeof Car._initialized == "undefined") { Car.prototype.showColor = function() { alert(this.color); }; Car._ini 阅读全文
posted @ 2012-07-15 23:10 Cloud Lee 阅读(376) 评论(0) 推荐(2) 编辑