1

I am trying to load in a div from my page the content of a different domain page. I've tried to use <object> or <iframe>, the content is loaded but I am not allowed to manipulate it with jQuery. Also, I had the same error:

XMLHttpRequest cannot load 'URL'. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:15297' is therefore not allowed access

, when I tried

$.get("URL", function (data) {
    $("#divID").append(data);
}

Is there any work around to load and manipulate content from different domain page with jQuery?

Dan
  • 31
  • 1
  • 5
  • You can't do either in the browser if you don't control the code on remote page also. Alternative is use a server side proxy – charlietfl Jun 05 '17 at 11:49

1 Answers1

0

You need to organise connection between child and parent page using postMessage.

Seems like this lib could help you https://github.com/travist/seamless.js

Arty9000
  • 103
  • 8