Working on these code for 2 days, but only find errors.
function one(){
var dictionary = 'https://rawcdn.githack.com/maheshmurag/bjspell/master/dictionary.js/en_US.js';
var lang = document.getLastRow(dictionary, function() {
check.disabled = false;
});
check.addEventListener('click', function() {
var text = div.innerText;
var words = text.split(/\s/);
div.innerHTML = words.map(function(word) {
var correct = lang.check(word);
var className = correct ? 'correct' : 'misspelled';
var title = correct
? 'Correct spelling'
: `Did you mean ${lang.suggest(word, 5).join(', ')}?`;
return `<span title="${title}" class="${className}">${word}</span>`;
}).join(' ');
});
reset.addEventListener('click', function() {
div.innerText = div.innerText;
});
}
Working on this code to make spell check in Google sheet but facing errors. Can anyone help me in these?
& Updated Script is you can check it in Google Sheet App Script & make it runnable for checking spelling errors & make spelling error-free sheet:
function one(){
var dictionary = 'https://rawcdn.githack.com/maheshmurag/bjspell/master/dictionary.js/en_US.js';
var document = Logger.log(dictionary, function() {
check.disabled = false;
});
check.addEventListener('click', function() {
var text = div.innerText;
var words = text.split(/\s/);
div.innerHTML = words.map(function(word) {
var correct = document.check(word);
var className = correct ? 'correct' : 'misspelled';
var title = correct
? 'Correct spelling'
: `Did you mean ${lang.suggest(word, 5).join(', ')}?`;
return `<span title="${title}" class="${className}">${word}</span>`;
}).join(' ');
});
reset.addEventListener('click', function() {
div.innerText = div.innerText;
});
}