JQuery $ .inArray not working with ASCII characters

As you can see in jsfiddle , I took two black coins. If I put a black coin on another black coin, then it should show a warning that β€œcan’t kill some kind of” and put the coins in their previous positions. But, as you can see, it does not work.

+5
source share
1 answer

I think your problem is that you are looking for an HTML entity, an encoded version of your UTF-8 characters. HTML Entity encoding uses the form &#XXXX;, where XXXXis the decimal value of the entity (in this case, the UTF-8 character code).

JavaScript JavaScript , \uXXXX, XXXX - . , hex , :

var blackCoins = ["\u265b", "\u265c"];

, , "" $.inArray(). , .

+2

All Articles