Professional Documents
Culture Documents
1
Webiste: https://haui.edu.vn © 2021 Hanoi
© 2021
University
HanoiofUniversity
Industry of
All Industry
rights reserved
All rights reserved
THIẾT KẾ WEB
2
Webiste: https://haui.edu.vn © 2021 Hanoi University of Industry All rights reserved
THIẾT KẾ WEB
GIỚI THIỆU VỀ
JAVASCRIPT
1
3
Webiste: https://haui.edu.vn © 2021 Hanoi University of Industry All rights reserved
THIẾT KẾ WEB
4
Webiste: https://haui.edu.vn © 2021 Hanoi University of Industry All rights reserved
THIẾT KẾ WEB
6
Webiste: https://haui.edu.vn © 2021 Hanoi University of Industry All rights reserved
THIẾT KẾ WEB
7
Webiste: https://haui.edu.vn © 2021 Hanoi University of Industry All rights reserved
THIẾT KẾ WEB
8
Webiste: https://haui.edu.vn © 2021 Hanoi University of Industry All rights reserved
THIẾT KẾ WEB
9
Webiste: https://haui.edu.vn © 2021 Hanoi University of Industry All rights reserved
THIẾT KẾ WEB
CÚ PHÁP TRONG
JAVASCRIPT
2
10
Webiste: https://haui.edu.vn © 2021 Hanoi University of Industry All rights reserved
THIẾT KẾ WEB
11
Webiste: https://haui.edu.vn © 2021 Hanoi University of Industry All rights reserved
THIẾT KẾ WEB
Hiển thị một dòng văn bản bằng câu lệnh document.write
Ghi ra nội dung thẻ HTML sử dụng innerHTML
Viết ra cảnh báo bằng cách sử dụng window.alert()
12
Webiste: https://haui.edu.vn © 2021 Hanoi University of Industry All rights reserved
THIẾT KẾ WEB
Phần thứ ba
Được dùng để lưu trữ một giá trị nào đó có thể là một chuỗi, một con số, một mảng, một phép
toán hoặc một đối tượng
Cách khai báo trong Javascript theo cú pháp
Var <tên_biến>;
<tên_biến>=giá_trị;
14
Webiste: https://haui.edu.vn © 2021 Hanoi University of Industry All rights reserved
THIẾT KẾ WEB
Trong lập trình, kiểu dữ liệu là một khái niệm rất quan trọng. Các biến trong
javascript có thể chứa nhiều kiểu dữ liệu khác nhau có thể là số, chuỗi, đối
tượng …
Tuy nhiên, Javascript vẫn có các kiểu dữ liệu cụ thể gồm: xâu, số, logic, đối
tượng, mảng và không định nghĩa
15
Webiste: https://haui.edu.vn © 2021 Hanoi University of Industry All rights reserved
THIẾT KẾ WEB
16
Webiste: https://haui.edu.vn © 2021 Hanoi University of Industry All rights reserved
THIẾT KẾ WEB
Hàm trong JavaScript là một khối lệnh được thiết kế để thực hiện một nhiệm vụ xác định
Hàm được thực thi khi nó được gọi, hàm có thể được gọi khi:
Một sự kiện xảy ra (khi người sử dụng kích chuột vào một nút lệnh).
Được gọi trọng đoạn mã JavaScript
Tự động gọi
Cú pháp:
17
Webiste: https://haui.edu.vn © 2021 Hanoi University of Industry All rights reserved
THIẾT KẾ WEB
Phần thứ tư
19
Webiste: https://haui.edu.vn © 2021 Hanoi University of Industry All rights reserved
THIẾT KẾ WEB
20
Webiste: https://haui.edu.vn © 2021 Hanoi University of Industry All rights reserved
THIẾT KẾ WEB
21
Webiste: https://haui.edu.vn © 2021 Hanoi University of Industry All rights reserved
THIẾT KẾ WEB
22
Webiste: https://haui.edu.vn © 2021 Hanoi University of Industry All rights reserved
THIẾT KẾ WEB
Xin cảm ơn
MÔN THIẾT KẾ WEB
BỘ MÔN KỸ THUẬT VÀ MẠNG MÁY TÍNH
23
Webiste: https://haui.edu.vn © 2021 Hanoi
© 2021
University
HanoiofUniversity
Industry of
All Industry
rights reserved
All rights reserved