判断网页是否在IFRAME或FRAME中
深入理解session与cookie
1. 当第一次请求一个网站,网站返回有session时只返回session的ID。当再请求这个网站的任何页面,都会把session的ID发送到服务器,页面返回不再有session ID 。 (continue reading…)
无限多级分类删除父id后子parent_id自动更新
删除一个分类以后,它的子分类的 parent_id 号就需要改变一下,而不能继续指向这个不存在的分类,因此我希望删除这个分类以后,它的子分类的父分类变为它的父分类。
lock tables `categories` write, `categories` as `c1` write, `categories` as `c2` write;
update `categories` as `c1`, `categories` as `c2` set `c1`.`parent_id` = `c2`.`parent_id` where `c1`.`parent_id` = `c2`.`cat_id` and `c2`.`cat_id` = $cat_id;
delete from `categories` where `cat_id` = $cat_id;
unlock tables;
这里需要注意的一点是,锁定表的时候,一定要把要操作的表和Mysql表别名都锁定,否则下面的语句会出错.
demo
TCA – color picker
The colorpicker wizard allows you to select a HTML color value from a user-friendly pop-up box. The wizard type is “colorbox” which will first of all add a colored box next to an input field. Here’s how it looks in a “haiku” record of the “examples” extension:
onefunction (color) (continue reading…)
JavaScript数组去掉重复
引用Ext中实现方法:
- unique: function( array ) { (continue reading…)
eventKey code
function checkNumber(event,objThis)
{
var eventKey = document.all ? event.keyCode : event.which;
if(!(eventKey>=48&&eventKey<=57) && eventKey != 8 )
return false;
}
<input type="text" size="4" maxlength="4" value="2" name="count" onkeypress="return checkNumber(event,this);">
text-indent 隐藏按钮文字
1: HTML Code
Create a HTML page and insert a button with a class, “button”. (continue reading…)
ie6 下 jquery的 submit不起作用
- 问题:
- 项目中所有使用jquery.submit()的方法在验证后提交在ie6中失去作用;
- 所有使用window.location.href=*** 方法在验证后在ie6中失去作用;
- 所有a链接中使用href=”javascript:void(0);”方法后在i6中点击失去使用;
- (失去作用意思为:点击后已经到后台取到值但页面并没有更新) (continue reading…)