I have to load the body of an HTML page without any style attribute and no link images and everything that is not 'plain text. I would like to do it in PHP and tried very solution but I have not solved. I load the html page with an ajax call to my script and then with a regular expression I take the body that then I want this cleared. Can you help me? This is the ajax call:
$.ajax({
type: "GET"
url: "core/proxy.php?url="+cerca,
success: function(data){
var body = data.replace(/^[\S\s]*<body[^>]*?>/i, "")
.replace(/<\/body[\S\s]*$/i, "");
$("div#risultato").html(body);
},
error: function(){
alert("failed");
}
});
});