jQuery Autocomplete与阿拉伯语单词

时间:2014-04-29 16:09:16

标签: php jquery html autocomplete

您好我试图使用jquery自动完成脚本在我的网站中使用。我想要它阅读阿拉伯语单词,我想知道是否有任何方法使其与阿拉伯语单词一起使用。我试着让它与mysql一起工作,但我非常努力。当我在文本框中写阿拉伯字母时,什么都没有。

<!doctype html>
<html lang="en">
<head>
  <meta charset="ISO-8859-6">
  <title>jQuery UI Autocomplete - Default functionality</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script>
  $(function() {
    var availableTags = [
      "علينا الدهر",
      "ActionScript",
      "Ali",
      "AppleScript",
      "Asp",
      "BASIC",
      "علي",
      "C",
      "C++",
      "Clojure",
      "COBOL",
      "ColdFusion",
      "Erlang",
      "Fortran",
      "Groovy",
      "Haskell",
      "Java",
      "JavaScript",
      "Lisp",
      "Perl",
      "PHP",
      "Python",
      "Ruby",
      "Scala",
      "Scheme"
    ];
    $( "#tags" ).autocomplete({
      source: availableTags
    });
  });
  </script>
</head>
<body>

<div class="ui-widget">
  <label for="tags">Tags: </label>
  <input id="tags">
</div>


</body>
</html>

1 个答案:

答案 0 :(得分:3)

将元字符集更改为UTF-8,如下所示:

<meta charset="UTF-8">

确认为我工作:

enter image description here