当前位置:网站首页>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 .
边栏推荐
- Programmers don't talk about morality, and use multithreading for Heisi's girlfriend
- 19. Framebuffer application programming
- Use of hutool Pinyin tool
- How to solve the component conflicts caused by scrollbars in GridView
- 总线的基本概念
- 724. Find the central subscript of the array
- Tf/pytorch/cafe-cv/nlp/ audio - practical demonstration of full ecosystem CPU deployment - Intel openvino tool suite course summary (Part 2)
- HMS v1.0 appointment. PHP editid parameter SQL injection vulnerability (cve-2022-25491)
- APScheduler如何设置任务不并发(即第一个任务执行完再执行下一个)?
- Build an Internet of things infrared temperature measuring punch in machine with esp32 / rush to work after the Spring Festival? Baa, no matter how hard you work, you must take your temperature first
猜你喜欢

Kubernets first meeting

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

Take you to quickly learn how to use qsort and simulate qsort
![[excel] PivotChart](/img/45/be87e4428a1d8ef66ef34a63d12fd4.png)
[excel] PivotChart

The end of the Internet is rural revitalization

High performance parallel programming and optimization | lesson 02 homework at home

光模塊字母含義及參數簡稱大全

谷歌 Chrome 浏览器将支持选取文字翻译功能

C # character similarity comparison general class

input显示当前选择的图片
随机推荐
Talk about the SQL server version of DTM sub transaction barrier function
HMS v1.0 appointment.php editid参数 SQL注入漏洞(CVE-2022-25491)
安装 Pytorch geometric
Redis realizes ranking function
win10清除快速访问-不留下痕迹
BUU-Crypto-[GUET-CTF2019]BabyRSA
Grounding relay dd-1/60
1480. 一维数组的动态和
Supplement the JS of a video website to decrypt the video
Upper computer software development - log information is stored in the database based on log4net
How to get the parent node of all nodes in El tree
19. Framebuffer application programming
Nexus 6p从8.0降级6.0+root
Install pytoch geometric
Zzulioj:1201: mode problem
Risc-v-qemu-virt in FreeRTOS_ Lock mechanism analysis of GCC
SQL injection - injection based on MSSQL (SQL Server)
光模塊字母含義及參數簡稱大全
BUU-Reverse-easyre
[QT] create mycombobox click event