当前位置:网站首页>Understanding of cross domain and how to solve cross domain problems
Understanding of cross domain and how to solve cross domain problems
2022-07-04 05:50:00 【Xiao Zhang ii】
If two addresses have the same agreement , Domain name or ip, And the port , Then we will say that these two addresses are from the same source , Browsers have a security policy for addresses of the same origin , That is to prohibit non homologous data operations dom,cookie And receiving ajax, So once there is cross domain , our ajax Cross domain errors will appear when receiving data . There are two solutions to this cross domain error reporting , One is cors Technical solutions , One is jsonp Technical solutions .
cors The solution depends entirely on the back end ( Personally, I am right nodejs There is also some research , Don't say it if you don't learn well ),cors Back end personnel can directly configure , At present commonly used ajax Version pair cors The technical support is very good , We can call the interface directly at the front end , The back end will use this technology to solve cross domain .
and jsonp There's a little bit of trouble , It looks like ajax request , He is a use script A technology of tag sending request , He is front and back , The data returned from the back end to the front end is not simply an object , It's a call to execute a function , Pass the data to be returned as parameters to the parameters of the executing function . Then it requires that the front end must prepare a global callback function to accept this data , When the program is finished , Function will be destroyed ,script Labels will also be destroyed ,jsonp It is compatible with lower version browsers . The disadvantage is that you can only send get request .
边栏推荐
- VB. Net GIF (making and disassembling - optimizing code, class library - 5)
- fastjson
- Google Chrome browser will support the function of selecting text translation
- JS string splicing enhancement
- Penetration tool - sqlmap
- Leetcode 184 Employees with the highest wages in the Department (July 3, 2022)
- 云原生架构实战案例及优化解决方案
- Basic concept of bus
- JS arguments parameter usage and explanation
- 509. 斐波那契数、爬楼梯所有路径、爬楼梯最小花费
猜你喜欢

How to configure static IP for Kali virtual machine

C # character similarity comparison general class
![[wechat applet] template and configuration (wxml, wxss, global and page configuration, network data request)](/img/78/63ab1a8bb1b6e256cc740f3febe711.jpg)
[wechat applet] template and configuration (wxml, wxss, global and page configuration, network data request)

SQL injection - injection based on MSSQL (SQL Server)

Actual cases and optimization solutions of cloud native architecture

AWT介绍

Gridview出现滚动条,组件冲突,如何解决

A little understanding of GSLB (global server load balance) technology

Letter meaning and parameter abbreviation of optical module Daquan

Penetration tool - sqlmap
随机推荐
LC周赛300
2022 R2 mobile pressure vessel filling retraining question bank and answers
BUU-Crypto-[GUET-CTF2019]BabyRSA
我的NVIDIA开发者之旅——优化显卡性能
Overview of relevant subclasses of beanfactorypostprocessor and beanpostprocessor
Halcon image calibration enables subsequent image processing to become the same as the template image
Viewing and using binary log of MySQL
Impact relay jc-7/11/dc110v
[Chongqing Guangdong education] electronic circuit homework question bank of RTVU secondary school
FRP intranet penetration, reverse proxy
配置交叉编译工具链和环境变量
谷歌 Chrome 浏览器将支持选取文字翻译功能
MySQL的information_schema数据库
报错cvc-complex-type.2.4.a: 发现了以元素 ‘base-extension‘ 开头的无效内容。应以 ‘{layoutlib}‘ 之一开头。
十二. golang其他
Review | categories and mechanisms of action of covid-19 neutralizing antibodies and small molecule drugs
云原生架构实战案例及优化解决方案
How to clone objects
gslb(global server load balance)技术的一点理解
1480. 一维数组的动态和