0

Try this bit of code someplace:

$("html").load("https://docs.google.com/document/d/1GoOvplDFuqx--ul60ATB1HfDz0o793g6ICD0VJnEHfc/export?format=txt",'',function(resp,x,y){document.write(resp);})

It's essentially a mirror of today's Wikipedia on my Google pseudo-CDN. However, I also tried this:

$("html").load("https://en.wikipedia.org/wiki/Main_Page",'',function(resp,x,y){document.write(resp);})

and it doesn't work.

Reference screenshots:

works

doesn't work

How can I fetch a dynamic site as HTML for printing?

Appleshell
  • 7,088
  • 6
  • 47
  • 96
Simon Kuang
  • 3,870
  • 4
  • 27
  • 53

1 Answers1

0

It is like you have a crossdomain problem because there is no 'Access-Control-Allow-Origin' header in the response. If this is not the case a browser usually does not allow to request a service located on another domain than the javascript that is triggering the request.

Use some server script to get the content from the particular url or use mod_proxy on the server config