博文

目前显示的是 2013的博文

改进EXTJS的maxlength设置

在写Extjs3的时候,发现textfield输入框的maxlength设置之后不能限制输入的长度,只能在输入超出maxlength之后给出错误提示。 Google之后,发现可以把下段代码放入程序,一起加载就可以解决这个问题。 // To fix the maxlength property // if the textfield sets {maxlength} property, it cannot be inputted more than {maxlength} characters. // before fixing, the textfield can be inputted any amount of characters. When it lose focus, the validation messages will show. Ext.form.TextField.prototype.size = 255; Ext.form.TextField.prototype.initValue = function() { if(this.value !== undefined){ this.setValue(this.value); }else if(this.el.dom.value.length > 0){ this.setValue(this.el.dom.value); } this.el.dom.size = this.size; if (!isNaN(this.maxLength) && (this.maxLength *1) > 0 && (this.maxLength != Number.MAX_VALUE)) { this.el.dom.maxLength = this.maxLength *1; } };

Buyvm.net的VPS主机DNS失效的问题

用这个VPS好长时间了,总体赶紧buyvm的主机越来越稳定,前两天机房搬迁,系统升级,服务断断续续的不稳定,恢复之后发现之前用的SSH代理不能用了,可以登录上,但是什么网页都不能访问。查看bitvise日志发现有错误: client connection closed before completion of protocol 问题原因:SSH 转发后系统DNS无法解析域名 解决办法:SSH登录到VPS修改DNS,添加GOOGLE的DNS到文件/etc/resolve.cnof nameserver 8.8.8.8 重启网络 /etc/init.d/netword restart 我发现不能用reboot重启VPS,重启之后/etc/resolve.conf文件又变回原来的配置。 特此推荐更稳定的 PhotonVPS ,价格便宜,配置也不错。 [ad#bottom banner of pages]

FeedSky绑定域名失效

在FeedSky上绑定的域名feed.lveyo.com的订阅地址已经失效很久了,FeedSky的DNS服务器的问题,久久得不到解决。 今天有时间,就决定把feed.lveyo.com域名指定到lveyo.com/feed目录上,放弃FeedSky. 首先在域名设置里DNS Manager里,原来Feed的那条记录删除掉。再添加一条A记录指向自己WordPress服务器的IP地址。 然后登录WordPress服务器,修改Nginx的设置,添加如下设置: server { listen 80; server_name feed.lveyo.com; rewrite ^(.*) http://lveyo.com/feed permanent; } 根据自己的域名将配置文件的域名替换之后,等待DNS生效就可以了。 [ad#bottom banner of pages]