AJAX将PHP转换为HTML [重复]

This question already has answers here:
                </div>
            </div>
                    <div class="grid--cell mb0 mt4">
                        <a href="/questions/3076414/ways-to-circumvent-the-same-origin-policy" dir="ltr">Ways to circumvent the same-origin policy</a>
                            <span class="question-originals-answer-count">
                                (11 answers)
                            </span>
                    </div>
            <div class="grid--cell mb0 mt8">Closed <span title="2014-06-03 06:04:47Z" class="relativetime">5 years ago</span>.</div>
        </div>
    </aside>

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?

</div>

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