Being a rookie in this area, I am eager to learn how to extract specific content from a page using AJAX in JQuery. Currently, I have been able to fetch the data of a page and display it as text:
$.ajax({
type: "POST",
url: "myfile.html",
success: function(data) {
$("#change").text(data);
},
error: function (request, ajaxOptions, exception){
alert(request.status);
alert(exception);
}
});
However, as you may already know, this method simply displays the source code of the entire page. For instance, if the contents of "myfile.html" look like this:
<html>
<body>
Hello!
</body>
</html>
I want to figure out how to use AJAX to only output "Hello!". Any suggestions?