$('#chkbox01').is(':checked');
9/05/2012
3/23/2012
[jQuery] 選取元素 (Selectors)
$('*')
取得所有元素
$('div')
取得所有
$('.class01')
取得所有class為class01的元素(class="class01")
$('#id01')
取得id為id01的元素(id="id01")
$("#id[1]")
取得id為id[1]的元素
印出所有id[]的元素 (在checkbox特好用)
$('#id[]').each(function(index) {
alert($(this).val());
});
關係選擇
$('div p')祖先元素是 div 的 p
$('div > p')
父元素是 div 的 p
$('div + span')
緊接在 div 之後的 p
$("option:selected",this).text()
$("select1 :selected").text()
7/26/2011
7/11/2011
CKEditor 3.x WYSIWYG Editor 所見即所得編輯器安裝及設定
CKEditor
官網:http://ckeditor.com/
下載:http://ckeditor.com/download
安裝方式:
以Appserv為例,下載後解壓縮到x:\appserv\www\ 底下就行了
之後可以到 http://<你的網址>/ckeditor/_samples/index.html 看到各種官方案例就成功了
簡單實作:
以下例子都是做一個name為textarea01的有CKEditor 功能的文字區塊出來
環境於www根目錄,ckeditor資料夾也於根目錄上
1/03/2011
[jQuery] 利用Google載入jQuery
KEY申請: http://code.google.com/intl/en/apis/loader/signup.html google.load("jquery", "1"); 版本號細節不填會自動抓最新的 例 "1" 會抓 1.4.4 "1.3" 會抓1.3.2
google.load() 一定要先載入,再開另外的<script>執行jQuery語法
[html]
<--key記得去申請並填上-->
<script src="http://www.google.com/jsapi?key=" type="text/javascript"></script></pre>
<!--more-->
<pre>
<script type="text/javascript">
google.load("jquery", "1");
</script>
<script type="text/javascript">
$(document).ready(function(){
window.setInterval('GetData()', 1000);
});
function GetData(){
$('#abc').load("testajaxinclude.php?timeStamp=" + new Date().getTime());
}
</script>
======================
<div id=abc>a</div>
======================
[/html]
訂閱:
文章 (Atom)