SlideShare a Scribd company logo
Introduction To
Technology Web Page
322431
Web
Technology
Computer
Science KKU
Agenda
Review Of
•  CSS
•  Json
•  Ajax
•  DOM
•  jQuery
Cascading Style Sheets:CSS
•  Separate format from content
•  Enforce consistency
•  Greatly simplify control &
maintenance
Style Sheet
1. Inline Styles
<Tag style="property:value;">
<p style="color:blue; font-family:Arial;
font-weight:bold”>Message Here</p>
2. Internal Style Sheet
<style type="text/css">
<!--selector {property1: value1;
property2: value2}... -->
</style>
External Style Sheet
<link rel="stylesheet" type="text/css" href="URL ไฟล์.css">
<html>
<head>
<link rel="stylesheet" type="text/css"
href="mystyle.css">
</head>
<body>
Example
Selector
Example
1. Class Selector
2. Id Selector
3. Tag Selector
1. Class Selector
/* Class Attribute */
.topic {color:red;
font-family:AngsanaUPC;
font-weight:bold;
text-align:center; }
<div class="topic”>ชื่อเรื่อง</div> 
<p class="topic”>หัวขอ</p> 
1. ชื่อ Class ตองนำหนาดวยเครื่องหมาย dot หรือ จุด ( . )  
2. ชื่อ Class หามขึ้นตนดวยตัวเลข เชน เขียน 18topic แบบนี้ไมได 
3. ชื่อ Class หามมีการเวนวรรค เชน จะเขียนเปน topic 11abc แบบนี้ไมได 
4. ชื่อ Class หามเปนภาษาไทย (ไมมีใครเขาตั้งชื่อแบบนี้กัน) 
2. Id Selector
#chapter {color:red; font-weight:bold}
<p id="chapter”>ขอความ</p> 
3. TAG Selectors
font{ font:16px Tahoma; color:red; }
<body>  
<font>TAG Selectors</font> 
</body> 
Java Script Object Notation : JSON
เปนวิธีการที่ทำให JavaScript แลกเปลี่ยนขอมูลกับ Server  
ปจจุบัน JSON นิยมใชในเว็บแอปพลิเคชัน โดยเฉพาะ AJAX โดย JSON
เปนฟอรแมตทางเลือกในการสงขอมูล นอกเหนือไปจาก XML ซึ่งนิยมใช
กันอยูแตเดิม สาเหตุที่ JSON เริ่มไดรับความนิยมเปนเพราะกระชับและ
เขาใจงายกวา XML 
สำหรับ Format ของรูปแบบคา JSON นั้นจะครอบดวยเครื่องหมาย { }
ตัวอยางเชน 
{
"name":Yaowaluck",
"email":"ypromdee@gmail.com"
}
สำหรับใน php สามารถแปลง JSON ดวย function ที่ชื่อวา
json_encode() และแปลงกลับดวย json_decode() 
Java Script Object Notation : JSON
JSON Code [{
"CustomerID":"C001",
"Name":”Yaowaluck Promdee",
"Email":”ypromdee@gmail.com",
"CountryCode":"TH",
"Budget":"1000000",
"Used":”123456"
}]
<?php
$arr[0][“customerID”]=“C001”;
$arr[0][“Name”]=“Yaowaluck Promdee”;
$arr[0][“Email”]=ypromdee@gmail.com;
$arr[0][“CountryCode”]=“TH”;”1000000”;
$arr[0][“Used”]=“123456”;
echo json_encode($arr);
?>
Ajax Asynchronous JavaScript and XML
Ajax Asynchronous JavaScript and XML
XHTML (หรือ HTML) และ CSS ใชในการแสดงผลลัพธและรูปแบบขอมูล 
ECMAScript เชนจาวาสคริปต ในการเขาถึง Document Object Model (DOM)
เพื่อใชในการแสดงขอมูลที่มีการเปลี่ยนแปลงหรือโตตอบกับผูใช 
XMLHttpRequest ใชในการแลกเปลี่ยนขอมูล asynchronously กับเว็บเซิรฟเวอร 
XML ใชเปนรูปแบบขอมูลในการแลกเปลี่ยน ซึ่งรูปแบบอื่นก็สามารถใชไดเชนกันไมวา
จะเปน HTML, JSON, EBML, หรือ เพลนเท็กซ 
<meta http-equiv="refresh" content="5;URL=url">
Ajax & HTML
ศึกษาเพิ่มเติม http://www.scriptdd.com/webtip/ajax-lesson-1.html
คือ การจัดเอกสาร HTML ใหอยูในรูปแบบของ DOM Tree โดยนิยาม objects และ
properties เพื่อใหโปรแกรมหรือสคริปต สามารถปรับเปลี่ยนโครงสราง, ขอมูล และ
styles ของ HTML DOM ผาน methods ได 
DOM (Document Object Model)
DOM แบงออกเปน 3 สวน 
 
1.  Core DOM – การจัดรูปแบบ DOM Tree สำหรับทุกๆ เอกสาร 
2.  XML DOM – การจัดรูปแบบ DOM Tree สำหรับเอกสาร XML 
3.  HTML DOM – การจัดรูปแบบ DOM Tree สำหรับเอกสาร HTML 
เขียนผังโครงสรางแบบ tree เพื่อใชในการอธิบาย DOM 
DOM
jQuery
jQuery นั้นเปน JavaScript Library ที่บรรจุเอา Function และ คำสั่งตางๆ 
•  ความสามารถในการทำงานแบบ ajax 
•  การสราง animation ไดแบบงายๆเลย ไมวาจะทำรูปใหเคลื่อนที่ หรือ DIV เชน
เอา mouse จับ DIV ลากไปมา 
•  ความสามารถในการ binds หรือการผูก หรือจับ function ที่เขาเขียนขึ้นให
ทำงานรวมกับ function อื่นๆ  
•  สามารถจัดการกับ css (style sheet) ลอง element นั้นๆได 
•  คนหา element ที่เราตองการและจัดการ เพิ่มหรือลบ Attributes ที่เรา
ตองการได 
•  ทำ Effect ตางๆกับ Element ที่เราตองการ เชนการ hide DIV ที่เราตองการ 
•  การดักเหตุการณตางๆ 
<html>
<head>
<title>JavaScript and HTML Sample</title>
<script>
function init()
{
alert("Loaded!!");
}
</script>
</head>
<body onLoad="init()">
</body>
</html>
jQuery Example
$('#div').fadeIn();
$('body').fadeOut();
$(document).ready(function(){ });

More Related Content

Similar to Web Technology

CSS คืออะไร?
CSS คืออะไร?CSS คืออะไร?
CSS คืออะไร?
Somsak Phusririt
 
สร้าง Style ด้วย css 3
สร้าง Style ด้วย css 3สร้าง Style ด้วย css 3
สร้าง Style ด้วย css 3
Samart Phetdee
 
Assignmet1 selectedtopic Topic in Computer Engineer
Assignmet1 selectedtopic Topic in Computer EngineerAssignmet1 selectedtopic Topic in Computer Engineer
Assignmet1 selectedtopic Topic in Computer Engineer
Aey Unthika
 
บทที่ 2 (21 02-56) okรันเลขแล้ว(แก้เหมายเลขหน้าด้วย ตั้งแต่หน้า 9 เป็นต้นไป )...
บทที่ 2 (21 02-56) okรันเลขแล้ว(แก้เหมายเลขหน้าด้วย ตั้งแต่หน้า 9 เป็นต้นไป )...บทที่ 2 (21 02-56) okรันเลขแล้ว(แก้เหมายเลขหน้าด้วย ตั้งแต่หน้า 9 เป็นต้นไป )...
บทที่ 2 (21 02-56) okรันเลขแล้ว(แก้เหมายเลขหน้าด้วย ตั้งแต่หน้า 9 เป็นต้นไป )...
Sarawut Panchon
 
Javacentrix com chap11-2
Javacentrix com chap11-2Javacentrix com chap11-2
Javacentrix com chap11-2Theeravaj Tum
 
Lab#12 java script
Lab#12 java scriptLab#12 java script
Lab#12 java scriptpalm2816
 
Html wordpress
Html wordpressHtml wordpress
Html wordpress
ungpao
 
CSS
CSSCSS
Assignmet1:Start by finding web services using SOAP and WSDL on the Internet/...
Assignmet1:Start by finding web services using SOAP and WSDL on the Internet/...Assignmet1:Start by finding web services using SOAP and WSDL on the Internet/...
Assignmet1:Start by finding web services using SOAP and WSDL on the Internet/...
Aey Unthika
 
การสร้างเว็บด้วย Bootstrap framework
การสร้างเว็บด้วย Bootstrap frameworkการสร้างเว็บด้วย Bootstrap framework
การสร้างเว็บด้วย Bootstrap framework
สอนทำโปรเจคจบ วิทคอมไอทีคอมธุรกิจ
 
Database Review for Midterm Exam
Database Review for Midterm ExamDatabase Review for Midterm Exam
Database Review for Midterm Exam
kunemata
 
รายงาน
รายงานรายงาน
รายงานkongdang
 
รายงาน
รายงานรายงาน
รายงานpim1122
 

Similar to Web Technology (20)

CSS คืออะไร?
CSS คืออะไร?CSS คืออะไร?
CSS คืออะไร?
 
สร้าง Style ด้วย css 3
สร้าง Style ด้วย css 3สร้าง Style ด้วย css 3
สร้าง Style ด้วย css 3
 
Css
CssCss
Css
 
Assignmet1 selectedtopic Topic in Computer Engineer
Assignmet1 selectedtopic Topic in Computer EngineerAssignmet1 selectedtopic Topic in Computer Engineer
Assignmet1 selectedtopic Topic in Computer Engineer
 
บทที่ 2 (21 02-56) okรันเลขแล้ว(แก้เหมายเลขหน้าด้วย ตั้งแต่หน้า 9 เป็นต้นไป )...
บทที่ 2 (21 02-56) okรันเลขแล้ว(แก้เหมายเลขหน้าด้วย ตั้งแต่หน้า 9 เป็นต้นไป )...บทที่ 2 (21 02-56) okรันเลขแล้ว(แก้เหมายเลขหน้าด้วย ตั้งแต่หน้า 9 เป็นต้นไป )...
บทที่ 2 (21 02-56) okรันเลขแล้ว(แก้เหมายเลขหน้าด้วย ตั้งแต่หน้า 9 เป็นต้นไป )...
 
Javacentrix com chap11-2
Javacentrix com chap11-2Javacentrix com chap11-2
Javacentrix com chap11-2
 
Lab#12 java script
Lab#12 java scriptLab#12 java script
Lab#12 java script
 
Html wordpress
Html wordpressHtml wordpress
Html wordpress
 
Jaxb
Jaxb Jaxb
Jaxb
 
JAXB
JAXBJAXB
JAXB
 
CSS
CSSCSS
CSS
 
Css 3
Css 3Css 3
Css 3
 
Fast web design
Fast web designFast web design
Fast web design
 
Assignmet1:Start by finding web services using SOAP and WSDL on the Internet/...
Assignmet1:Start by finding web services using SOAP and WSDL on the Internet/...Assignmet1:Start by finding web services using SOAP and WSDL on the Internet/...
Assignmet1:Start by finding web services using SOAP and WSDL on the Internet/...
 
JAXB
JAXBJAXB
JAXB
 
JAXB
JAXBJAXB
JAXB
 
การสร้างเว็บด้วย Bootstrap framework
การสร้างเว็บด้วย Bootstrap frameworkการสร้างเว็บด้วย Bootstrap framework
การสร้างเว็บด้วย Bootstrap framework
 
Database Review for Midterm Exam
Database Review for Midterm ExamDatabase Review for Midterm Exam
Database Review for Midterm Exam
 
รายงาน
รายงานรายงาน
รายงาน
 
รายงาน
รายงานรายงาน
รายงาน
 

More from Yaowaluck Promdee

A basic of UX for beginner
A basic of UX for beginnerA basic of UX for beginner
A basic of UX for beginner
Yaowaluck Promdee
 
TCAS 2563
TCAS 2563TCAS 2563
Portfolio design
Portfolio designPortfolio design
Portfolio design
Yaowaluck Promdee
 
Concept to creation story and storyboard
Concept to creation  story and storyboard Concept to creation  story and storyboard
Concept to creation story and storyboard
Yaowaluck Promdee
 
Observation and interviewing
Observation and interviewingObservation and interviewing
Observation and interviewing
Yaowaluck Promdee
 
Requirement gathering-and-lean-canvas
Requirement gathering-and-lean-canvasRequirement gathering-and-lean-canvas
Requirement gathering-and-lean-canvas
Yaowaluck Promdee
 
Good bad design
Good bad designGood bad design
Good bad design
Yaowaluck Promdee
 
Bootstrap Framework
Bootstrap Framework Bootstrap Framework
Bootstrap Framework
Yaowaluck Promdee
 
Tables and forms with HTML, CSS
Tables and forms with HTML, CSS  Tables and forms with HTML, CSS
Tables and forms with HTML, CSS
Yaowaluck Promdee
 
Navigation and Link
Navigation and LinkNavigation and Link
Navigation and Link
Yaowaluck Promdee
 
Graphic, Color and tools
Graphic, Color and toolsGraphic, Color and tools
Graphic, Color and tools
Yaowaluck Promdee
 
Page layouts flexible and fixed layout with CSS
Page layouts flexible and fixed layout with CSSPage layouts flexible and fixed layout with CSS
Page layouts flexible and fixed layout with CSS
Yaowaluck Promdee
 
CSS Boc model
CSS Boc model CSS Boc model
CSS Boc model
Yaowaluck Promdee
 
CSS Font & Text style
CSS Font & Text style CSS Font & Text style
CSS Font & Text style
Yaowaluck Promdee
 
Style and Selector Part2
Style and Selector Part2Style and Selector Part2
Style and Selector Part2
Yaowaluck Promdee
 
Style and Selector
Style and SelectorStyle and Selector
Style and Selector
Yaowaluck Promdee
 
Design sitemap
Design sitemapDesign sitemap
Design sitemap
Yaowaluck Promdee
 
Good/Bad Web Design
Good/Bad Web DesignGood/Bad Web Design
Good/Bad Web Design
Yaowaluck Promdee
 
HTML 5
HTML 5HTML 5
Overview HTML, HTML5 and Validations
Overview HTML, HTML5 and Validations Overview HTML, HTML5 and Validations
Overview HTML, HTML5 and Validations
Yaowaluck Promdee
 

More from Yaowaluck Promdee (20)

A basic of UX for beginner
A basic of UX for beginnerA basic of UX for beginner
A basic of UX for beginner
 
TCAS 2563
TCAS 2563TCAS 2563
TCAS 2563
 
Portfolio design
Portfolio designPortfolio design
Portfolio design
 
Concept to creation story and storyboard
Concept to creation  story and storyboard Concept to creation  story and storyboard
Concept to creation story and storyboard
 
Observation and interviewing
Observation and interviewingObservation and interviewing
Observation and interviewing
 
Requirement gathering-and-lean-canvas
Requirement gathering-and-lean-canvasRequirement gathering-and-lean-canvas
Requirement gathering-and-lean-canvas
 
Good bad design
Good bad designGood bad design
Good bad design
 
Bootstrap Framework
Bootstrap Framework Bootstrap Framework
Bootstrap Framework
 
Tables and forms with HTML, CSS
Tables and forms with HTML, CSS  Tables and forms with HTML, CSS
Tables and forms with HTML, CSS
 
Navigation and Link
Navigation and LinkNavigation and Link
Navigation and Link
 
Graphic, Color and tools
Graphic, Color and toolsGraphic, Color and tools
Graphic, Color and tools
 
Page layouts flexible and fixed layout with CSS
Page layouts flexible and fixed layout with CSSPage layouts flexible and fixed layout with CSS
Page layouts flexible and fixed layout with CSS
 
CSS Boc model
CSS Boc model CSS Boc model
CSS Boc model
 
CSS Font & Text style
CSS Font & Text style CSS Font & Text style
CSS Font & Text style
 
Style and Selector Part2
Style and Selector Part2Style and Selector Part2
Style and Selector Part2
 
Style and Selector
Style and SelectorStyle and Selector
Style and Selector
 
Design sitemap
Design sitemapDesign sitemap
Design sitemap
 
Good/Bad Web Design
Good/Bad Web DesignGood/Bad Web Design
Good/Bad Web Design
 
HTML 5
HTML 5HTML 5
HTML 5
 
Overview HTML, HTML5 and Validations
Overview HTML, HTML5 and Validations Overview HTML, HTML5 and Validations
Overview HTML, HTML5 and Validations
 

Web Technology

  • 1. Introduction To Technology Web Page 322431 Web Technology Computer Science KKU
  • 2. Agenda Review Of •  CSS •  Json •  Ajax •  DOM •  jQuery
  • 3. Cascading Style Sheets:CSS •  Separate format from content •  Enforce consistency •  Greatly simplify control & maintenance
  • 4. Style Sheet 1. Inline Styles <Tag style="property:value;"> <p style="color:blue; font-family:Arial; font-weight:bold”>Message Here</p> 2. Internal Style Sheet <style type="text/css"> <!--selector {property1: value1; property2: value2}... --> </style>
  • 5. External Style Sheet <link rel="stylesheet" type="text/css" href="URL ไฟล์.css"> <html> <head> <link rel="stylesheet" type="text/css" href="mystyle.css"> </head> <body> Example
  • 7. 1. Class Selector /* Class Attribute */ .topic {color:red; font-family:AngsanaUPC; font-weight:bold; text-align:center; } <div class="topic”>ชื่อเรื่อง</div>  <p class="topic”>หัวขอ</p>  1. ชื่อ Class ตองนำหนาดวยเครื่องหมาย dot หรือ จุด ( . )   2. ชื่อ Class หามขึ้นตนดวยตัวเลข เชน เขียน 18topic แบบนี้ไมได  3. ชื่อ Class หามมีการเวนวรรค เชน จะเขียนเปน topic 11abc แบบนี้ไมได  4. ชื่อ Class หามเปนภาษาไทย (ไมมีใครเขาตั้งชื่อแบบนี้กัน) 
  • 8. 2. Id Selector #chapter {color:red; font-weight:bold} <p id="chapter”>ขอความ</p>  3. TAG Selectors font{ font:16px Tahoma; color:red; } <body>   <font>TAG Selectors</font>  </body> 
  • 9. Java Script Object Notation : JSON เปนวิธีการที่ทำให JavaScript แลกเปลี่ยนขอมูลกับ Server   ปจจุบัน JSON นิยมใชในเว็บแอปพลิเคชัน โดยเฉพาะ AJAX โดย JSON เปนฟอรแมตทางเลือกในการสงขอมูล นอกเหนือไปจาก XML ซึ่งนิยมใช กันอยูแตเดิม สาเหตุที่ JSON เริ่มไดรับความนิยมเปนเพราะกระชับและ เขาใจงายกวา XML  สำหรับ Format ของรูปแบบคา JSON นั้นจะครอบดวยเครื่องหมาย { } ตัวอยางเชน  { "name":Yaowaluck", "email":"ypromdee@gmail.com" }
  • 10. สำหรับใน php สามารถแปลง JSON ดวย function ที่ชื่อวา json_encode() และแปลงกลับดวย json_decode()  Java Script Object Notation : JSON JSON Code [{ "CustomerID":"C001", "Name":”Yaowaluck Promdee", "Email":”ypromdee@gmail.com", "CountryCode":"TH", "Budget":"1000000", "Used":”123456" }] <?php $arr[0][“customerID”]=“C001”; $arr[0][“Name”]=“Yaowaluck Promdee”; $arr[0][“Email”]=ypromdee@gmail.com; $arr[0][“CountryCode”]=“TH”;”1000000”; $arr[0][“Used”]=“123456”; echo json_encode($arr); ?>
  • 12. Ajax Asynchronous JavaScript and XML XHTML (หรือ HTML) และ CSS ใชในการแสดงผลลัพธและรูปแบบขอมูล  ECMAScript เชนจาวาสคริปต ในการเขาถึง Document Object Model (DOM) เพื่อใชในการแสดงขอมูลที่มีการเปลี่ยนแปลงหรือโตตอบกับผูใช  XMLHttpRequest ใชในการแลกเปลี่ยนขอมูล asynchronously กับเว็บเซิรฟเวอร  XML ใชเปนรูปแบบขอมูลในการแลกเปลี่ยน ซึ่งรูปแบบอื่นก็สามารถใชไดเชนกันไมวา จะเปน HTML, JSON, EBML, หรือ เพลนเท็กซ  <meta http-equiv="refresh" content="5;URL=url"> Ajax & HTML ศึกษาเพิ่มเติม http://www.scriptdd.com/webtip/ajax-lesson-1.html
  • 13. คือ การจัดเอกสาร HTML ใหอยูในรูปแบบของ DOM Tree โดยนิยาม objects และ properties เพื่อใหโปรแกรมหรือสคริปต สามารถปรับเปลี่ยนโครงสราง, ขอมูล และ styles ของ HTML DOM ผาน methods ได  DOM (Document Object Model) DOM แบงออกเปน 3 สวน    1.  Core DOM – การจัดรูปแบบ DOM Tree สำหรับทุกๆ เอกสาร  2.  XML DOM – การจัดรูปแบบ DOM Tree สำหรับเอกสาร XML  3.  HTML DOM – การจัดรูปแบบ DOM Tree สำหรับเอกสาร HTML 
  • 15. jQuery jQuery นั้นเปน JavaScript Library ที่บรรจุเอา Function และ คำสั่งตางๆ  •  ความสามารถในการทำงานแบบ ajax  •  การสราง animation ไดแบบงายๆเลย ไมวาจะทำรูปใหเคลื่อนที่ หรือ DIV เชน เอา mouse จับ DIV ลากไปมา  •  ความสามารถในการ binds หรือการผูก หรือจับ function ที่เขาเขียนขึ้นให ทำงานรวมกับ function อื่นๆ   •  สามารถจัดการกับ css (style sheet) ลอง element นั้นๆได  •  คนหา element ที่เราตองการและจัดการ เพิ่มหรือลบ Attributes ที่เรา ตองการได  •  ทำ Effect ตางๆกับ Element ที่เราตองการ เชนการ hide DIV ที่เราตองการ  •  การดักเหตุการณตางๆ 
  • 16. <html> <head> <title>JavaScript and HTML Sample</title> <script> function init() { alert("Loaded!!"); } </script> </head> <body onLoad="init()"> </body> </html> jQuery Example $('#div').fadeIn(); $('body').fadeOut(); $(document).ready(function(){ });