Category Archives for 未分类
input 或者 textarea focus reset
表单项的时候,可能input的border想表红,结果浏览器默认的outline给的颜色套在上面,很变扭(其实默认的outline是个好东西,能不干掉尽量不要去干掉) 下面的css可以reset 那个样式,只是测了mac 下的chrome和 safari :-moz-any-link :focus { outline: none; } :focus { -moz-outline-style: none; outline: none; }
.reset() form with jQuery
$(‘#formId’).reset(); // error: $(“#formId”).reset() is not a function google 之后发现 function resetForm(id){ $(‘#’+id).each(function(){ this.reset(); }); //$(‘#’+id)[0].reset(); } 哈哈~~mark一下
javascript(js) 检测 中文,英文和数字
莫旋同学 需要 通过js检测 输入框职能是中文,英文和数字 (/^[\u2E80-\uFE4Fa-z0-9A-Z]+$/).test(’222我WAa33_’); mark一下
php 删除 txt文本的任意一行
思路: 读入文件转换成数组 unset数组相应的一项 最后写回文件 code: function delLineFromFile($fileName, $lineNum){ // check the file exists if(!is_writable($fileName)) { // print an error print “The file $fileName is not writable”; // exit the function exit; } else { // read the file into … Continue reading
oocss.org
oocss.org 另外的思路编写更加精简的css 看到上面的demo代码,感觉豁然开朗~~很爽 框架的方式完全可以通过oocss上的方式非常简单的实现
Using Fiddler with Firefox
Fiddler 最新的fiddler,安装以后再firefox的右下角会有一个fiddler的开关选择 但是问题来了,一般前端都会安装多个firefox,这个时候只会在一个版本的firefox,其他的版本是不会自动安装的。 下面的方法是手动修改方式: Install and Run Fiddler once. This will create some files, one of which you’ll need. In “My Documents” you will now see that there is folder for Fiddler. Inside there you’ll find a Scripts folder. Grab … Continue reading
获取dom的属性值
获取dom的属性值 <input name=”123″ abc=”456″ /> 获取原生自带属性 //input.name 获取使用者自己添加属性 // input.getAttribute(“abc”) 今天在firefox获取input.abc 结果是undefined。。。突然想起老大曾经分享过这个。。。
[转贴]VIM乱码解决办法
http://blog.csdn.net/ZOLoveGD/archive/2009/02/18/3904448.aspx Vim 可以很好的编辑各种字符编码的文件,包括 UCS-2、UTF-8 等流行的 Unicode 编码方式: Vim 有四个跟字符编码方式有关的选项,encoding、fileencoding、fileencodings、termencoding,它们的意义如下: * encoding: Vim 内部使用的字符编码方式,包括 Vim 的 buffer (缓冲区)、菜单文本、消息文本等; * fileencoding: Vim 中当前编辑的文件的字符编码方式,Vim 保存文件时也会将文件保存为这种字符编码方式 (不管是否新文件都如此); * fileencodings: Vim 启动时会按照它所列出的字符编码方式逐一探测即将打开的文件的字符编码方式,并且将 fileencoding 设置为最终探测到的字符编码方式。因此最好将 Unicode 编码方式放到这个列表的最前面,将拉丁语系编码方式 latin1 放到最后面; * termencoding: Vim 所工作的终端 (或者 Windows 的 … Continue reading
progress-lose
As we make progress, we also lose ground
form对象小陷阱
前段时间开发项目做好了demo给开发,demo是没有问题。 结果开发说页面的form怎么也提交不了。。。- -!!! <form id=”formId” action=”http://xxx.com” method=”post”> <input name=”username”> <input name=”submit” type=”submit”> </form> <script src=”http://k.kbcdn.com/global/utilities/utilities_1_4_8.js” ></script> <script> var _E = YAHOO.util.Event; _E.on(“formId”,”submit”,function(ev){ _E.stopEvent(ev); /* 处理乱七八糟的东西 */ this.submit(); //最后提交; }); </script> demo 上面的代码不能正常运行,firebug报this.submit is not a function 代码一比对发现 <input name=”submit” type=”submit”> … Continue reading