Files
ClassContent/历届学生/fontendsix/每日课程/2021-11-05/笔记.txt
2024-09-27 02:06:13 +08:00

62 lines
1.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

ajax
web 开发模式
1: 服务端(后端)渲染
后端:1万 jquery 写页面(30% js+html+css) 数据库 实现功能 做安全 (70%)
前端:3千 写页面(70% html+css) ( 30% )
优:方便做 seo 优化
缺:后端工作任务量大,代码维护艰难
2: 前后端 分离
后端:1.8k 数据库 写功能(业务) 做安全
前端:1.7k 写页面 做功能(前端) 做安全 app,桌面端,后端
优:代码维护方便,分工明确,减少前后端扯皮的次数,提供研发效率
缺:
用什么开通讯?
ajax
xml http request xhr
GraphQL
ajax 同源策略(浏览器)
前端:file:///C:/Users/bmy/Desktop/2021-11-05/index.html
http://127.0.0.1:8080/index
后端:http://127.0.0.1:3000/api/index/hot
1:协议
http 80
https 443
2:域名
3:端口
解决浏览器的同源策略(解决跨域)
1:后端设置cors请求头,允许前端访问
2: jsonp+callback(回调函数) 资源文件请求绕过浏览器的ajax同源策略
3:服务端代理(后端语言,nginx,apache)
A(自己前端)
|
B(自己公司的后端)
|
C(别人后端)