简体   繁体   中英

How to communicate between two external pages with js

Let's say first page is microsoft.com and the second one is google.com

I can make first page send POST data by using console but I cannot reach that data it in google.com in any way I can think of. After I reach it, I will also need to use it.

Is it possible to do that with only JS?

I think I can do that with something like iMacros and chrome extension development but I want to do it in JS.

Any ideas?

If you will use AJAX, you will probably get something like this:

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<your-domain>' is therefore not allowed access.

The Javascript Origin Policy is going to prevent you from making Ajax request to another domain

If we are talking about API like box.com etc., try to use YQL or something similar.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM