0

I have a website on two domains. I want to load a file what is on a different server.

When I load it like this (same server) it works perfect

$("#prijslijst1").load("info_prijs_vd.html");

however when I try this

$("#prijslijst1").load("www.example.com/info_prijs_vd.html");

it doesn't load. I've tried also http://www.example.com etc.
I can't figure it out what's wrong here. Any suggestion?

Richard de Ree
  • 2,329
  • 4
  • 30
  • 47
  • Define "it doesn't work". Also, you need to use a full url - `http://www.example.com/info_prijs_vd.html`. BUT, you are also likely going to have to deal with [CORS](http://stackoverflow.com/questions/11736431/make-cross-domain-ajax-jsonp-request-with-jquery/11736771#11736771) – random_user_name Nov 24 '16 at 17:48
  • do you have permission to do a cross request to that domain? – Claudio Redi Nov 24 '16 at 17:49
  • If you do run into CORS issues you can always use https://crossorigin.me – jmona789 Nov 24 '16 at 17:50
  • [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) – Moob Nov 24 '16 at 17:51
  • @ClaudioRedi I don't know actually. I testing on a raspberry singleboard computer. With Apache2 with default settings. – Richard de Ree Nov 24 '16 at 17:53

1 Answers1

0

As this post perfectly exposes Loading cross domain endpoint with jQuery AJAX

You are running into a CORS issue.

You need to follow the steps in the post I described, in order to solve your issue.

Cheers!

Community
  • 1
  • 1