[轉貼] 多!?

學多懂多,懂多煩多,煩多想多,
想多做多,做多付多,付多拿多,
拿多花多,花多吃多,吃多病多,
病多-日子不多,最好還是別管那麼多,開心多多!

Categories FUN

範例程式 jQuery /JSON / PHP /json_encode / json_decode sample code

jQuery : 請參考這篇 : http://jsgears.com/thread-63-1-1.html

Microsoft 也提供 video 教學: http://msdn.microsoft.com/zh-tw/asp.net/dd310332.aspx#jQuery

$(document).ready( function(){
  var data = new Object();
  data.hello = "Hello";
  data.world = 'World';
  data.worked = " it worked ";
  data.somebool = true;
  data.array = new Array("he\"ll\"o", '"World"');
  var dataString = $.toJSON(data);
  $.post('phpfile.php', {data: dataString}, function(res){
      var obj = $.evalJSON(res);
      if(obj.somebool === true)
      $("#result").html(obj.hello + ' ' + obj.array[1] + obj.worked + ". Message from PHP: "+obj.php_message);
    });
});

… 未完

颱風天在家練功 – CSS / jQuery

jQuery :

  1. a
  2. #ID : 符何 ID 的元素
  3. .Class : match class items
  4. a#ID.Class : match a tag and ID and Class

 

 

 

這兩天把 blog 的 theme 換了 , 換成黑的 , 也把 javascript 整理了一下

 

筆記一點, CSS 裡面: ID 選擇器用 # 表示 , 類選擇器用 “.” 表示

寫了一個有意思的小程式, 在這! 怎玩呢? 要先在格子內填一下資料, 不清楚的人搞不好真的填了 ID / PW , 然後呢 mouse 不小心就移到底下, 就觸動了 mouseover 的 event , 於是好玩的狀況來了….看程式可以清楚 monster 在搞什麼.

這表示啥呢…就是如果這個頁面若可以外掛別人寫的 javascript 那麼別人就可以取得 user 在這頁面上輸入的資料.

[code language=’html’]
 

帳號 :密碼 :

mouse 經過這邊會 onMouseOver 喔!

 


[/code]

TODO

Singleton

http://www.wikigps.com/

http://ajax.googleapis.com/ajax/libs/jquery/1.2/jquery.min.js
http://code.google.com/apis/ajaxlibs/documentation/index.html#jquery

選 opener 中的物件
$(’#selector’, opener.document)