smart85 Posted November 2, 2007 Share Posted November 2, 2007 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 More sharing options...
mainewoods Posted November 3, 2007 Share Posted November 3, 2007 do you have php on your server? ajax can call call php which can call a file on another web site and then send it down the ajax pipe. Link to comment https://forums.phpfreaks.com/topic/75789-solved-request-on-other-domain/#findComment-384332 Share on other sites More sharing options...
smart85 Posted November 5, 2007 Author Share Posted November 5, 2007 I know this method... but there is no possibility to use PHP on this server. This script must only use JS and AJAX. It will work on many different domains and connect to one "server" domain. Link to comment https://forums.phpfreaks.com/topic/75789-solved-request-on-other-domain/#findComment-384913 Share on other sites More sharing options...
smart85 Posted November 7, 2007 Author Share Posted November 7, 2007 I found solution... I've tried the code: <object data="http://mySite.com/script.php" type="text/html">...</object> This code can works on different sites and allow me to use AJAX with another domain. Link to comment https://forums.phpfreaks.com/topic/75789-solved-request-on-other-domain/#findComment-386540 Share on other sites More sharing options...
mainewoods Posted November 9, 2007 Share Posted November 9, 2007 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? Link to comment https://forums.phpfreaks.com/topic/75789-solved-request-on-other-domain/#findComment-387898 Share on other sites More sharing options...
smart85 Posted November 13, 2007 Author Share Posted November 13, 2007 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... Link to comment https://forums.phpfreaks.com/topic/75789-solved-request-on-other-domain/#findComment-390530 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.