Javascript总体概述:

js是指在网页上编写的脚本语言,是对HTML在功能上的扩展

js代码嵌入在HTML里,在客户端的浏览器上执行,属于前端语言

 

document是个对象,是指当前网页

.write()指属性,将内容写入网页中

 

加载外部js文件:

<script src="/js/test.js"></script>

test.js文件中包含:

alert("hello,world");

加载外部文件:

<script src="URL"></script>

 

document常用属性:

document.cookie,返回当前页面的cookie

document.location,返回当前页面的URL

location.href实现页面跳转

location.href="URL"

 

confirm("内容")弹出选择框

 https://www.freebuf.com/articles/web/222849.html 关于html编码的用途

posted on 2021-04-18 10:47  EndlessShw  阅读(29)  评论(0编辑  收藏  举报