0
JavaScript & jQuery 基本入門
MARK CHEN

2014/1/19

1
JavaScript – Types of Data
內建三種基本資料型態(primitive data type)
數值(number)
NaN不等於任何值,NaN也不等於NaN

字串(string)
布林值(boolean)

...
Object
建立Object:
var obj = new Object();
或使用物件實字(Object literal)的方式
建立:
var obj = {};
也可為Object直接設定properties:
var pers...
Function
function是物件,是Function的實例
也因為是Function的實例,所以可以將function傳給另
一個變數參考
var max = new Function('num1', 'num2', 'return...
使用jQuery
<script src=“js/jquery-1.8.3-min.js”></script>
<script>
$(document).ready(function(){
//Code is write here
)};
</...
Upcoming SlideShare
Loading in...5
×

Mark java script & jquery 基本入門

278

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
278
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Mark java script & jquery 基本入門"

  1. 1. JavaScript & jQuery 基本入門 MARK CHEN 2014/1/19 1
  2. 2. JavaScript – Types of Data 內建三種基本資料型態(primitive data type) 數值(number) NaN不等於任何值,NaN也不等於NaN 字串(string) 布林值(boolean) 複合資料型態(composite data type) 物件(object) 特殊的值 null → var x = null;  null表示沒有任何東西 undefined → var x; 或 void x;  當試圖去取得某個沒指定任何值、或null、或properties的變數時,就會出現undefined的結果 2014/1/19 2
  3. 3. Object 建立Object: var obj = new Object(); 或使用物件實字(Object literal)的方式 建立: var obj = {}; 也可為Object直接設定properties: var person = { name: „Mark‟, age: 30 }; 2014/1/19 只要簡單指定就可以幫Object直接 加上新的properties或是function obj.x = 10; obj.y = „This is string!‟; 存取properties的表示法 obj.x; > 10 obj[„x‟]; > 10 3
  4. 4. Function function是物件,是Function的實例 也因為是Function的實例,所以可以將function傳給另 一個變數參考 var max = new Function('num1', 'num2', 'return num1 > num2 ? num1 : num2'); 或 function max(num1, num2) { return num1 > num2 ? num1 : num2; } var maximum = max; 2014/1/19 4
  5. 5. 使用jQuery <script src=“js/jquery-1.8.3-min.js”></script> <script> $(document).ready(function(){ //Code is write here )}; </script> $(document).ready()的作用就是等網頁全部都 載入完成之後,才開始執行Javascript 使用jQuery從$()開始 $(„#menu‟).hover( function(){ $(„#submenu‟).show();  簡潔寫法: <script src=“js/jquery-1.8.3-min.js”></script> <script> $(function(){ //Code is write here )}; </script> 2014/1/19 }, function(){ $(„#submenu‟).hide(); } ); 5
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×