1

I would like to call and show a page from another domain to my domain using ajax/javascript. I would like to hide the original url of the page. (Example in the case of surveymoneky, I can load the survey page in my web site with out showing the surverymonkyes url.)

How can I do it ?

Thanks in advance..

Regards,

Sunil

Sunil Kumar P
  • 113
  • 1
  • 11

1 Answers1

1

Due to the SOP (same origin policy) implemented in browsers, you can only retrieve information from another domain using Ajax if the other domain allows that by setting the Access-Control-Allow-Origin response header to the domain where the request originated.

devnull69
  • 16,402
  • 8
  • 50
  • 61
  • Dear devnull Thanks for your valuable time and support . Could u plz make it clear please... – Sunil Kumar P Sep 04 '12 at 10:05
  • I am trying to push my service page to my clients web site , I would like to hide my domain url in that page . How can I set Access-Control-Allow-Origin response header in my visitors side. Could u plz direct me to the right way... Thanks – Sunil Kumar P Sep 04 '12 at 10:12
  • Example for PHP: `header('Access-Control-Allow-Origin: http://www.yourotherdomain.com')` where www.yourotherdomain.com is the domain that sends the request – devnull69 Sep 04 '12 at 11:41