we are currently trying to implement the AJAX example with the german dictionary.
Without the dictionary set, it works like a charm but with the dictionary option set ($Spelling.DefaultDictionary = "Deutsch";) we get the following errors:
Undefined offset: 2 in /Users/xxx/xxx/xxx/web/JavaScriptSpellCheck/core/php/engine.php on line 8
Stack trace:
{main}() /Users/xxx/xxx/xxx/web/JavaScriptSpellCheck/core/index.php:0
require() /Users/xxx/xxx/xx/web/JavaScriptSpellCheck/core/index.php:27
PHPSpellCheck->LoadDictionary() /Users/xxx/xxx/xxx/web/JavaScriptSpellCheck/core/settings/default-settings.php:25
PHPSpellCheck->DecypherStrDict() /Users/xxx/xxx/xxx/web/JavaScriptSpellCheck/core/php/engine.php:8
127.0.0.1:53672 [200]: /JavaScriptSpellCheck/core/?note=&command=APIDYM&args=keyword&lan=Deutsch&sender=0&settingsfile=default-settings
Code looks exactly like the AJAX example:
$Spelling.DefaultDictionary = "Deutsch";
var timoutInterval;
function keyStroke(){
clearTimeout(timoutInterval);
timoutInterval =setTimeout( ajaxDYM(),500)
}
function fixSuggestions(link){
SearchBoxText = document.getElementById('ctrl_keywords_70').value = link.innerHTML;
link.innerHTML = "";
}
function ajaxDYM(){
var SearchBoxText = document.getElementById('ctrl_keywords_70').value;
var o = $Spelling.AjaxDidYouMean(SearchBoxText);
o.onDidYouMean = function(result){
var oSuggestionLink= document.getElementById('suggestionLink');
if(result){
oSuggestionLink.innerHTML = result
}else{
oSuggestionLink.innerHTML = "";
}
}
}