chrome拼写检查输入iframe

时间:2018-10-02 19:48:12

标签: javascript html google-chrome iframe spell-checking

我正在尝试在iframe的输入字段中使用浏览器的拼写检查。在IE中,按预期方式在HTML中添加router.put('/editablerecords/update', function (req, res) { let qb_TxnID = req.body.txnid let type = req.body.type; let margin = req.body.margin; if (!qb_TxnID) { return res.status(400).send({ error:true, message: 'Please provide TxnID' }); } connection.query('SELECT id, qb_TxnID, type, margin from QuoteToClose where qb_TxnID = ?', estimate_id, function( error, results, fields ) { if(error){ res.send(JSON.stringify({"status": 500, "error": error, "response": null})); //If there is error, we send the error in the error section with 500 status } else { if (results.length = 0) { //INSERT connection.query("INSERT INTO QuoteToClose SET ? ", { 'qb_TxnID': qb_TxnID, 'type': type, 'margin': margin }, function (error, results, fields) { if(error){ res.send(JSON.stringify({"status": 500, "error": error, "response": null})); //If there is error, we send the error in the error section with 500 status } else { res.send(JSON.stringify({ error: false, data: results, message: 'New record has been created successfully.' })); //If there is no error, all is good and response is 200OK. } }); } else { //UPDATE connection.query("UPDATE QuoteToClose SET ? WHERE qb_TxnID = '" + qb_TxnID + "'", { type, margin }, function (error, results, fields) { if(error){ res.send(JSON.stringify({"status": 500, "error": error, "response": null })); //If there is error, we send the error in the error section with 500 status } else { res.send(JSON.stringify({ error: false, data: results, message: 'Record updated.' })); //If there is no error, all is good and response is 200OK. } }); } // res.send(JSON.stringify({"status": 200, "record_count": results.length, "error": null, "response": results})); //If there is no error, all is good and response is 200OK. } }); 属性。在Chrome中,除非启用了“检查文本字段的拼写”功能,否则它不会对任何单词进行拼写检查。

我正在使用iframe。 src链接到输入标签的jsp代码所在的其他jsp文件。

spellcheck

基于这个(旧)站点,输入不提供带有<iframe spellcheck="true" id="popupBot" class="botIframe" src="CHAT_URL" height="100%" width="100%"></iframe> 属性的拼写检查。即使我将spellcheck HTML标记更改为input,除非启用了“检查文本字段的拼写”功能,否则拼写检查将不起作用。我尝试将textareaspellcheck添加到表单标签中,但是没有成功。

contenteditable

https://blog.whatwg.org/the-road-to-html-5-spellchecking#compatibility

还有其他方法可以在chrome输入或文本字段中进行拼写检查吗?自定义拼写检查是唯一的选择

谢谢

0 个答案:

没有答案