記錄一下 用法
很基本的JSON 用法 :重點在於Server 丟給 Client的資料格式
與Client 如何取出值
XXX.htm
yuanann 發表在 痞客邦 留言(0) 人氣(3,277)
記錄一下用法
用法的關鍵就是 attr 和 disabled 而以 ^^
<html>
<head>
<title>JQuery control the text button </title>
<script src="jquery.js" type="text/javascript"></script>
yuanann 發表在 痞客邦 留言(0) 人氣(2,702)
以下代碼是利用jquery 來檢查某一元素是否存在 記錄一下 ^^
<html>
<head>
<script src="jquery.js" type="text/javascript"></script>
<script>
$(document).ready(function(){
if ($("#div_id").length) ////if ($("#div_id")) 也可以
{
alert("do something");
}
});
</script>
</head>
<body>
<div id="div_id"></divs>
yuanann 發表在 痞客邦 留言(0) 人氣(1,585)
學習記錄
使用this 對元素進行處理動作
<html>
<head>
<title>Jquery-Sample-this </title>
<script type="text/javascript" src="./jquery.js"></script>
<script type="text/javascript">
function click()
{
$('#div_picture').show();
}
function move()
{
$('#div_picture').hide();
}
$(document).ready(function() {
$('#div_picture').hide();
$('.picture').click(function () {
url_id = $(this).attr("id");
pictre_url = $(this).attr('value');
$('#picture_id').attr('src', pictre_url)
$(this).bind('click',click);
$(this).bind('mouseout',move);
});
});
</script>
</head>
<body align="left">
<div id="show_picture_0" value="http://sstatic.net/so/img/logo.png" > show picture </div>
<div id="show_picture_1" value="http://imageshack.us/images/greylogo.png" > abcd </div>
<div id="div_picture" ><img id="picture_id" src=""></div >
</body>
</html>
yuanann 發表在 痞客邦 留言(0) 人氣(1,785)
目前支援 safari, opera, msie, mozilla 應該夠用了 ^^
範例如下
<HTML>
<HEAD>
<script src="jquery.js"> </script>
<TITLE> rolling image </TITLE>
</HEAD>
<BODY>
<div onclick="check_browser()" >Check Browser</div>
<script>
function check_browser()
{
//support : safari, opera, msie, mozilla
if($.browser.msie){
alert("IE");
return IE ;
}
if($.browser.mozilla){
alert("mozilla");
return mozilla ;
}
}
</script>
</BODY>
</HTML>
yuanann 發表在 痞客邦 留言(0) 人氣(655)
css 是用來設定樣式的
在JQuery 中 用法如下
<div id="abc" color="blue">div test</div>
yuanann 發表在 痞客邦 留言(0) 人氣(2,392)