There are two different domains, the first item in the domain click on a button and then invoke the project interface in the second domain name, and then implement the logic function in the project of the second domain name, I want to ask the big gods how to return the project data in the second domain name to the first domain name call function.
Reply content:
There are two different domains, the first item in the domain click on a button and then invoke the project interface in the second domain name, and then implement the logic function in the project of the second domain name, I want to ask the big gods how to return the project data in the second domain name to the first domain name call function.
This is a cross-domain Baidu you will know
With JSONP
Back end, it is called by the second domain to provide a similar restful API through HTTP,
If you must have a front-end call, which solves the cross-domain problem first, Ajax is your best choice, if there is a cross-domain problem, there are josnp optional
If the interface is called for a Web page, you can use JSONP, but only for get requests. You can also use Ajax, to solve cross-domain, need to add Origin header.
Jsonp or Ajax+header ("access-control-allow-origin:*");