Issue with Empty TD

Issue with Empty TD

katyaverillkatyaverill Posts: 1Questions: 0Answers: 0
edited November 2013 in DataTables 1.9
I have a table that generates keyword density based upon text pasted into a textarea. It currently has a TD that is empty and it's messing up all of my other calculations, so I want to get rid of that row completely. I'm really stuck trying to figure out how to :(
I'd really appreciate any help!

Here's the link to the debugger: http://debug.datatables.net/ibahin

[code]
<!doctype html>










var commonWords=/\b(and|a|an|has|he|to|was|in|were|are|is|will|as|it|if|with|at|its|it's|be|by|on|that|from|the|about|again|all|almost|also|although|always|among|another|any|be|because|been|before|being|between|both|by|can|could|did|do|does|doesn't|'|done|due|during|each|either|enough|from|had|has|have|having|here|i|if|into|is|isn't|itself|just|may|might|most|mostly|must|nor|no|neither|nearly|of|often|on|our|ours|The|his|hers|he's|he|she|she's|overall|perhaps|quite|rather|really|regarding|seem|seems|seen|several|should|show|showewd|shown|shows|significant|significantly|since|so|some|such|than|that|then|their|theirs|there's|therefore|these|they|this|those|through|thus|to|upon|use|used|using|various|very|was|we|were|what|when|which|while|with|within|without|would|however|or|for|the|but|etc|yet)\b/g;
commonWords.ignoreCase;
$( document ).ready( function() {
$('form').submit(function(event){
event.preventDefault();
var
keyword_list = $('#searchtext').val().split(" "),
word_list = $('#searchtext').val().split(" "),
nwords = word_list.length;
$('#result').html(nwords + " Total Words in Article");
keyword_dict = {};
for (var i = 0, w; w = keyword_list[i]; i++) {
var w = w.replace(/\W/g,'');
var w = w.replace(commonWords,'');
var w = w.replace(/\d/g,'');
keyword_dict[w] = 0;
}
for (var i = 0, w; w = word_list[i]; i++) {
var w = w.replace(/\W/g,'');
var w = w.replace(commonWords,'');
var w = w.replace(/\d/g,'');
for(var keyword in keyword_dict){
if (keyword == w){
keyword_dict[w] += 1;
}
}
}

items = 'unique keywordsoccurancepercent of text';
for (keyword in keyword_dict){
var occ = keyword_dict[keyword]*100/nwords;
var c='';
items += ''+keyword+''+keyword_dict[keyword]+''+occ.toPrecision(2)+'';
}
console.log(keyword_dict);
$('#result').append(''+items+'');
$('#result table').dataTable();
});
});


Keyword Density Analyzer

Article:










[/code]
This discussion has been closed.