Reference
[1]static method in javascript
http://stackoverflow.com/questions/1535631/static-variables-in-javascript
JerryCheng 發表在 痞客邦 留言(0) 人氣(61)
JerryCheng 發表在 痞客邦 留言(0) 人氣(50)
idList = [];
$('.jobs').each(function(){
if($(this).attr("checked"))
{
idList.push($(this).attr('jobid'));
}
});
JerryCheng 發表在 痞客邦 留言(0) 人氣(1)
在Javascript中 , 我們可以藉由取得html element並進行control ,
當然 , checkbox 也不會是例外:
<html>
<head>
JerryCheng 發表在 痞客邦 留言(11) 人氣(1,096)
在Javascript中 , 我們可以去偵測一些事件是否發生 ,
像mouse的動作 , 或者是keyboard的動作 ,
而如果想要偵測keyboard的event , 並取得該按鍵的ASCII code ,
我們可以藉由以下的方法:
JerryCheng 發表在 痞客邦 留言(0) 人氣(114)
JerryCheng 發表在 痞客邦 留言(0) 人氣(595)
在網頁中 , 若我們想在使用者在按下Button時而觸發event , 基本上的做法有兩種:
1. 在input 的tag中註明click後所觸發的function.
2. 用Javascript取得html element , 並藉由onmousedown來決定要trigger的function.
JerryCheng 發表在 痞客邦 留言(0) 人氣(128)
在regular expression中 , 我們可以藉由g modifier來決定是否進行global match ,
(也就是match所有符合的部分 , 而非只停留在第一個)
var str="Is this all there is?";
JerryCheng 發表在 痞客邦 留言(0) 人氣(44)
在Javascript中 , 我們若想在某一個event 被trigger時 , 讓某一個function也同時進行處理 ,
我們可以藉由Jquery所提供的bind() method:
$(document).bind('mousedown', {trigger: $("#usertypesel")}, divhide);
其中三個參數分別是: eventType , eventData , 以及handler.
JerryCheng 發表在 痞客邦 留言(0) 人氣(77)
在Javascript的Array object中 , 提供了一個sort method來幫我們對Array進行sort的動作:
jsonMgmt.sort(function(a , b)
{
return a.intername > b.intername;
JerryCheng 發表在 痞客邦 留言(0) 人氣(66)