We have the latest update for Ajax installed today and have found an issue with the RadSpell control. If you type a value of 'tha' into a textbox/text area control that spell check will target, you will get an error 'Uncaught SyntaxError: Unterminated string in JSON' error in the console. This is able to replicated within the demo page of the Spell control.
Remove the text in the first textbox in this page and replace it with 'tha' and in the console you will see the error shoot off.
Hi Chris,
Thank you for reporting this issue! I’ve reproduced it and converted the ticket into a public bug report so that other users experiencing the same problem will be notified.<telerik:RadTextBox ID="RadTextBox1" Text="tha" runat="server"></telerik:RadTextBox>
<telerik:RadSpell DialogsScriptFile="scripts.js" ID="RadSpell1" runat="server" ControlsToCheck="RadTextBox1"></telerik:RadSpell>
Telerik.Web.UI.SpellCheckService.prototype._processResponse = function(executor, args) {
var statusCode = executor.get_statusCode();
if (executor.get_responseAvailable() && 200 == statusCode && executor.get_responseData().length > 0) {
var result = executor.get_object();
alert(1)
if (result.badWords != null) {
var jsonCompatible = result.badWords;
jsonCompatible = jsonCompatible.replace(/([{,]\s*)([a-zA-Z0-9_]+)\s*:/g, '$1"$2":');
jsonCompatible = jsonCompatible.replace(/'((?:\\.|[^\\'])*)'/g, '"$1"');
jsonCompatible = jsonCompatible.replace(/\\'/g, "");
result.badWords = JSON.parse(jsonCompatible);
}
if (result.wordOffsets != null) {result.wordOffsets = JSON.parse(result.wordOffsets); }
this.raise_complete(executor.get_object());
} else {
if (executor.get_timedOut()) {
alert('Spell Check Request time out');
} else if (executor.get_aborted()) {
alert('Spell Check Request aborted');
} else if (404 == statusCode) {
window.alert('Web.config registration missing!\n The spellchecking functionality requires a HttpHandler registration in web.config. Please, use the control Smart Tag to add the handler automatically, or see the help for more information.\n\n' + this.get_url());
} else if (statusCode > 0 && statusCode != 200) {
window.alert('Spell Check Handler Server Error:' + statusCode + '\n' + executor.get_responseData());
}
}
}
As a small token of gratitude for your contribution, your Telerik points have been updated. We appreciate your help in improving our product!
Regards,
Rumen
Progress Telerik
Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!