Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
See all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
JavaDevTeam
notes
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
notes
/
JavaSript
/
javascript-入门.js
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
53 lines (40 loc) · 1.14 KB
master
Breadcrumbs
notes
/
JavaSript
/
javascript-入门.js
Copy path
Top
File metadata and controls
Code
Blame
53 lines (40 loc) · 1.14 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--
--
--
--
--
--
--
--
--
--
--
--
--
--
JavaScript
-
入门
|
--
--
--
--
--
--
--
--
--
--
--
--
--
--
#
1995
年的脚本语言
,
是网景公司开发
#
最开始它的目的仅仅是为了作为
'浏览器表单校验'
而存在
#
JavaScript由三部分组成
ECMAScript
*
提供了核心的语言功能
*
是一个标准
,
Javascript实现了这个标准
*
Flash也实现了这个标准
文档对象模型
(
DOM
)
*
提供操作网页内容的方法和接口
浏览器对象模型
(
BOM
)
*
提供与浏览器交互的方法与接口
#
浏览器的支持
*
一般浏览器都支持了
ECMAScript
*
但是对于
DOM
和
BOM
有些差异
--
--
--
--
--
--
--
--
--
--
--
--
--
--
JavaScript
-
使用
|
--
--
--
--
--
--
--
--
--
--
--
--
--
--
#
JavaScript是一种解释形的脚本语言
#
在HTML中的JavaScript书写在
<
script
>
<
/
script
>
标签中
* 该标签可以放在任何地方
* 但是一般都是放在
<
head
>
标签之中
<
script
>
//代码
</
script
>
# 也可以由
<
script
>
标签引入JS的文件
<
script
src
=
"./xxx.js"
>
</
script
>
* 如果引入了脚本文件,那么该标签体中的JS代码将不会执行
* script 标签的属性
src
* 指定脚本文件的地址,可以跨域,可以是相对路径也可以是绝对路径
type
* 类型,一般都是:text/javascript
charset
* 字符集
defer
* 值为:fefer,意思是,延迟执行脚本
* 当整个页面都加载完毕后才会执行该脚本的代码
You can’t perform that action at this time.