在 Jquery 中未显示在表格上的 Ã 或 Õ 上的特殊字符重音'~'



我有这个代码https://jsfiddle.net/nbadnkb8/10/当我在Safari(IOS(中单击"~"关键字时,它无法在表格单元格上显示"或",但在Chrome中运行良好(IOS和windows系统(。有人能帮我吗?非常感谢。

$(document).keydown(function(e) {
var inp = String.fromCharCode(e.keyCode);
if ((!(/[a-zA-Z0-9-_ ]/.test(inp) || e.keyCode == 96)) && e.keyCode != 8){
reCalculate(e);
rePosition();
// if key is an arrow key, don't type the user input.
// if it is any other key (a, b, c, etc)
// edit the text
if (e.keyCode > 36 && e.keyCode < 41) {
return false;
}
}

});

尝试将<meta charset="UTF-8">添加到页面的页眉中。

最新更新