jquery表单验证器未正确显示阿拉伯字母

时间:2013-04-01 15:11:57

标签: javascript jquery validation arabic

我正在尝试使用jQuery表单验证,我希望验证文本是阿拉伯语。

问题在于,当我在.js文件中更改该短语时,它会显示正方形而不是阿拉伯字母。

这是我的js文件:

$(document).ready(function(){
    // Place ID's of all required fields here.
    required = ["name", "email", "country", "message"];
    // If using an ID other than #email or #error then replace it here
    email = $("#email");
    errornotice = $("#error");
    // The text to show up within a field when it is incorrect
    emptyerror = "Please fill out this field.";
    emailerror = "Please enter a valid e-mail.";

所以我想把最后两行“请填写......”和“请输入......”改为阿拉伯语。

我已经尝试将此代码:charset=UTF-8添加到头部,但仍然无效。

任何想法如何解决?

1 个答案:

答案 0 :(得分:1)

这也发生在我身上。

然后我意识到我的编辑器使用了另一种编码......

所以只需将编辑器上的编码更改为utf-8。