I took another look at the Web Service definition on MSDN and saw that the chunksToSpell expects a System.String type. So, I rewrote the code to look like this (same error :():
function spellChecker(str) {
var strTemp = str;
var aryChunks = [];
var strChunks = '';
var intArrayLength = 0;
var spellResults = '';
strTemp = str.replace(/\r?\n|\r/g, ' ');
aryChunks = strTemp.split(" ");
intArrayLength = aryChunks.length;
for(var i = 0; i < intArrayLength; i++){
if(aryChunks[i] != '') {
strChunks += "<string>" + aryChunks[i] + "</string>";
}
}
$().SPServices({
operation: "SpellCheck",
chunksToSpell: strChunks,
declaredLanguage: 1033,
useLad: false,
completefunc: function(xData, Status){
alert(xData.responseText);
}
});
}
↧