Jump to content

Request in ajax


blague
 Share

Recommended Posts

AJAX cannot send a request to a script on another domain, AJAX requests can only be to the same domain. PHP can communicate cross-domain though, so you could have one PHP page that you send your AJAX requests to that can check with the other script if necessary.

Link to comment
Share on other sites

Hi, is possible to make connection in two different domains and to change data between scripts in this domains with iframe and ajax request .Sorry to bad description for my problem.Please help me !
not with ajax. it can (kinda) be done with iframes using the location.search property to pass 2kb of data at a time.if you encode your data in JSON, or even a javascript-safe string, you read the data from anywhere by adding it from a script tag.let me elaborate:you can talk TO the iframe with GET parameters like <iframe scr="http://outsidedomain.com/thepage.htm?name=fred" ></iframe>on thepage.html, you can save data to a temp file (in json), and that data can be reached from the top page by pointing a script tag to the temp file.of course, if you don't control both pages, this will be virtually impossible to do.with two temp JSON files, you could also communicate two ways, but you will need write access on both servers, and the timing of when to add the script tags can become troublesome.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...