I want to do the following.
$("a").click(function (event) {
event.preventDefault();
$.get($(this).attr("href"), function(data) {
$("html").html(data);
});
});
I want the behavior of all hyperlinks to make a ajax calls and retrieve the html.
Unfortunately you cannot simply replace the current html with the html you receive in the ajax response.
How can grab only what is within the <body> </body>
tags of the ajax response so that i can replace only the contents of the body in the existing html.
Edit: the <body>
opening tag will not always be just <body>
it may sometimes have a class e.g.
<body class="class1 class2">