I am using an Ajax request to get the content of an HTML file. However, I would only like to use the last 50 lines of this HTML file.
The content of my HTML file looks like this:
<div class='userMessage'>01-12-2014 at 07:37 PM - <b>User</b>: message<br></div>
<div class='userMessage'>01-12-2014 at 07:38 PM - <b>User</b>: message<br></div>
The lines are all seperated with an end line: \n
My Ajax request looks like this:
$.ajax({
url: "file.html",
cache: false,
success: function(html){
$("#div").html(decodeHTMLEntities(html));
}
});
Any help would be highly appreciated.
Please use below code. Last fifty lines would be printed from last record.