Tuesday, October 30, 2012

regexp regular expression
php 5:
int preg_match ( string $pattern , string $subject [, array &$matches [, int $flags = 0 [, int $offset = 0 ]]] )

JS:

/\d{4}-\d{2}-\d{2}/.test('2007-01-25');     // true
'2007-01-25'.match(/\d{4}-\d{2}-\d{2}/);    // true

DHTMLX 在使用treegrid的方式宣告出grid表格會造成一些原有的onclick事件失效,例如checkbox在裡面他是用自己的方式寫,事用onclick事件去驅動BOX改變,在onclick事件失效後,checkbox變成只能固定不能更改。
CSS special use

shadow

      -webkit-box-shadow: 2px 2px 3px #222222;
      -moz-box-shadow: 2px 2px 3px #222222;
      box-shadow: 2px 2px 3px #222222;

radius
/* support Safari, Chrome */
-webkit-border-radius: 5px;
/* support firefox */
-moz-border-radius: 5px;
border-radius: 5px;

http://www.cbflabs.com/book/cce/cce.htm

Monday, October 22, 2012


Q1.
1.1me = $('#win_content_copy').find('#categoryname');
alert(me.value).text();

[ans:]its worng. text() alert-method response undefined.

1.2alert(me.text());
[ans:]its working

1.3alert(me.val());
[ans:]when we use input marksigned ,have to

Q2.time control

//sleep(4000);
//setInterval("categoryname_keydown();", 3000);
//event.timeStamp;
//setTimeout("alert ('called from setTimeout()');",4000);
Q3.when you clone a DOM element

window_content_copy = $('#window_content').clone();
window_content_copy.attr('id','win_content_copy');
window_content_copy.appendTo('#body');

is html inside script syntax
onclick='function(this)'  (<---wrong)
onclick='function($(this))'   (<---right)



Thursday, October 18, 2012


PDO使用時要注意
使用prepare
在execute若有LIKE條件時
%必須放到excute參數內
放在原始$sql會出錯

 $sql = "SELECT id,full_xxxx_name
                       FROM xxxx
                       WHERE full_xxxx_name LIKE :xxxx_name;";

        $statement = $connection->prepare($sql);

        $statement->execute(array(':xxxx_name' => $inputname."%"));

取消表單輸入時的自動完成


<form>
    <input type="password" name="Password" autocomplete="off">
</form>


or

<form autocomplete="off">
    <input type="password" name="Password" >
</form>


//JavaScript
//HTML
//function onchange() test

<input type="text" onkeydown="myFunction()">


Tuesday, October 16, 2012


black ground:

  <div id="mask" style="filter: Alpha(opacity=30); -moz-opacity: 0.3; -khtml-opacity: 0.3;
  opacity: 0.3; background-color: #000; width: 100%; height: 100%; z-index: 5px;
  position: absolute; left: 0; top: 0; display: none; overflow: hidden;">
  </div>

jqurey
 $('#blackmask').show("slow") ;