Jump to content

Loading http://www.bla.com... AJAX that call https://secure.bla.com... Possible?


ltrem

Recommended Posts

Hey guys,

 

I want to know if it is possible to call, with AJAX function, a link that doesn't have the same domain name...

 

Here is the pattern:

 

the page http://www.bla.com is loaded ,

 

there is an onclick button that call a Javascript function ,

 

in that function, there is some AJAX. The AJAX call a script on a different domain which is that one : https://secure.bla.com

 

Is this possible?

 

Currently not working, and was wondering if it was only possible and if yes, how?

basicly that second example is jsonp (json with padding). I do think you need access to the server for the script that gives the json response since it's a bit different.

 

The following example I found using google http://a.webvm.net/ you can even see the php source which makes the jsonp possible.

 

If you don't have access to the server you want to use that will output a response, then you're better off using cURL or just any serverside script that can read remote data. With a script like that you could make a remote ajax call a local ajax call.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.