拼写检查器无法在tinymce 4.0中工作(非JSON响应)
Spellchecker is not working in tinymce 4.0 (Non JSON response)
我试图在TinyMCE 4.0中使用拼写检查器,但它返回错误:
Non JSON response:<br />
<b>Warning</b>: call_user_func_array() [<a href='function.call-user-func-array'>function.call-user-func-array</a>]: First argument is expected to be a valid callback, 'PSpellShell::spellcheck' was given in <b>/home/www/misitio.com/doc/plugins/tinymce/plugins/spellchecker/rpc.php</b> on line <b>98</b><br />
{"id":null,"result":null,"error":null}
我使用的代码是:
//Javascript:
tinymce.init({
selector: "textarea",
theme: "modern",
language : 'es',
menubar : false,
height: 400,
autoresize_min_height: 400,
plugins: [
"advlist autolink lists link image charmap hr",
"searchreplace wordcount visualchars fullscreen",
"insertdatetime table contextmenu directionality",
"template textcolor autoresize spellchecker"
],
toolbar: "undo redo | styleselect | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | forecolor backcolor | subscript superscript | removeformat blockquote | charmap inserttime | link image | table hr | searchreplace | fullscreen spellchecker",
image_advtab: true,
spellchecker_languages : "+English=en",
spellchecker_rpc_url: 'plugins/tinymce/plugins/spellchecker/rpc.php'
});
带有插件PHP Spellchecker 2.0.6.1(http://www.tinymce.com/develop/changelog/?type=phpspell)
我认为你可以通过谷歌来解决连接问题https://github.com/tinymce/tinymce_spellchecker_php只是不知道如何集成它,有人能够在TinyMCE 4.0中使用拼写检查器吗?或者他们知道有任何将Spellchecker集成到TinyMCE 4.0的教程吗?
好吧,谢谢!:D
这个问题可以通过更新php拼写检查器插件中的几行来解决。
1) 将EnchantSpell、GoogleSpell、PSpell、PSpellShell和Sp-ellChecker类的"&checkWords"方法重命名为"&spellcheck"
2) 更新拼写检查方法以返回以下格式的数据
array(
'incorrect word 1'=>array('suggestion 1','suggestion 2', etc...),
'incorrect word 2'=>array('suggestion 1','suggestion 2', etc...),
)
例如,让我们更新EnchantSpell.php文件的拼写检查方法
…
if(!$correct) {
//$returnData[] = trim($value);
$returnData[trim($value)] = $this->getSuggestions($lang, trim($value));
}
…
试着像这样传递call_user_func_array的第一个参数:
call_user_func_array(array("PSpellShell","spellcheck"), $arguments);
据我所知,谷歌关闭了这项服务。你不应该再使用它了。
相关文章:
- Javascript:JSON请求仅在第一次工作
- JSON:查询联接表不工作(Cordova Mobile)
- Json到CSV下载,可以在chrome中工作,但不能在IE浏览器中工作
- JSON.stringify没有'在更改的对象上无法按预期工作.如何处理
- 使用JsonResult传递Json无法正常工作
- 为什么我的JavaScript / JSON脚本不能在Internet Explorer中工作
- 在什么情况下,应该.deep.equal失败,但使用JSON.stringify进行比较工作正常
- jQuery JSON flickr提要返回false不工作
- AngularJS JSON漏洞保护是如何工作的
- Javascript:JSON.stringify未按预期工作
- 解析json只能部分工作
- 使用ASP.Net MVC Web Api将JSON数据导出到Excel工作表
- 谷歌散点图-{role:'style'}{role:#39;工具提示'}不能以JSON形式工作
- Polymer v1.3.1数据绑定无论是否使用带有重复模板和json数组的iron ajax都无法工作
- 序列化方向结果到 JSON 发送到我的网络服务无法正常工作
- JSon 工作光中的解析错误
- 从 JSON Href 获取在表中工作的按钮
- Json.Encode 在 CS 文件中工作,但不在 CSHTML 中工作
- AngularJS检查下载的json是否在工作副本之间有差异
- 无法集成无限滚动到现有的工作JSON脚本