Nate Nate - 2 years ago 106
Ajax Question

Sending the body of a page to another server?

Is it possible to send the body of a page (i.e. all of the HTML code/DOM) from a page on one server to another and then receive a response? The method used doesn't really matter, but I do have access to jQuery functions if that helps.

Answer Source

You could do this by sending...

$("html").html(); an ajax call:

var data = $("html").html();
    url: "/echo/json/",
    data: data,
    type: "POST"
}).done(function(res) {

Working jsFiddle:

(See console for body output).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download