logo
Apache Lounge
Webmasters

 


About

Forum Index Downloads Search Register Log in  RSS Apache Lounge
 



Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.



Cross domain security with ajax request

 
Post new topic   Reply to topic    Apache Forum Index -> Coding & Scripting Corner



View previous topic :: View next topic  
Author Message
jasemilly



Joined: 30 Aug 2013
Posts: 3

PostPosted: Fri 30 Aug '13 15:03    Post subject: Cross domain security with ajax request Reply with quote

Hi New to the forum so hello to everyone!!!!

I have created a site that is hosted on apache, that makes a ajax request to a 3rd party site that isn't hosted on apache but the same server, when I am on the same lan as the server everything works.

I created a dyndns address and set up a virtual host and the site opens from the WAN ok.

But my AJAX call isn't returning anything, when I check in firebug all my call are waiting for an answer.

I am pretty new to apache. I think this issue is some cross domain security issue.

What do I need to change to allow the AJAX call through and does this have a knock on effect to my virtual host.

Thanks for any help have been working on this for sometime and so close to getting it all working,

all help appreciated.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 6202
Location: Germany, Next to Hamburg

PostPosted: Sat 31 Aug '13 11:05    Post subject: Reply with quote

Cross domain does not work with javascript, that is why I made a proxy script to tunnel the request.
http://mariobrandt.de/archives/php/jquery-ajax-cross-domain-request-307/
Back to top
jasemilly



Joined: 30 Aug 2013
Posts: 3

PostPosted: Mon 02 Sep '13 9:17    Post subject: javascript not working Reply with quote

Hi
I am not using Javascript I found a PHP tutorial to make the call.

Is their anything I need to change in apache or anyway I can get more information on what is causing the block?

thanks
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 6202
Location: Germany, Next to Hamburg

PostPosted: Mon 02 Sep '13 10:49    Post subject: Reply with quote

in the top of the script
Code:

error_reporting(E_ALL);
ini_set('display_errors', 1);
Back to top
jasemilly



Joined: 30 Aug 2013
Posts: 3

PostPosted: Fri 06 Sep '13 11:35    Post subject: Error message Reply with quote

It doesn't error the ajax call is just sat waiting for a reply.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 6202
Location: Germany, Next to Hamburg

PostPosted: Fri 06 Sep '13 12:09    Post subject: Reply with quote

My guess, but it is just a guess is that the script can't connect to the server.
Back to top


Post new topic   Reply to topic    Apache Forum Index -> Coding & Scripting Corner
Page 1 of 1