Jump to content

[SOLVED] request on other domain


smart85

Recommended Posts

Hi,

I've got problem with AJAX request... I've read forum, but i didn't find solution for this problem.

 

Is there any possibility to make AJAX request for another domain?? I know that AJAX is blocking this kind of requests...

I cann't use file with PHP scripts... only JS. Maybe i can use cookies instead of file with PHP script??

 

Is there any solution for my problem??

Link to comment
https://forums.phpfreaks.com/topic/75789-solved-request-on-other-domain/
Share on other sites

I never heard of an object solution like that, how does that work? I notice that you seem to be specifying a php page on your site:

data="http://mySite.com/script.php"

is that a php page on your site? How does communication between the object and the php page and vice versa work?

Object is used like simple 'frame'. Inserting one site into another...

 

When you add 'object' tag with data="path_to_your_site" into site on other domain, you can use ajax scripts like you use it on your site...

 

For example:

You have one domain (firstDomain.com), and after page load you want to execute some ajax script from other domain(secondDomain.com/siteWithAJAXScript.htm)... Only way (only way i found), to do that is to execute this ajax from 'object' who is connected with your secondDomain.com.

 

<object width="400" height="400" type="text/html" data="secondDomain.com/siteWithAJAXScript.htm">

</object>

 

On siteWithAJAXScript.htm you must to enter AJAX script who will be execute on firstDomain.com. Script must to have paths to secondDomain.com...

 

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.