简体   繁体   中英

jquery airport plugin : How can I make it work with special characters?

I'm using the cool jquery airport plugin and trying to make it accept special characters (like accents, "&", etc.). By default it only works with az.

Has anybody found how to do that ?

There is a chars array that you can add characters to.

var chars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', ' ', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '-'];

Doing this should be enough.

PS: Sometimes, looking at the source code of a program can be really enlightening. ;-)

You have to set up the chars array correctly.

var chars = ['a', ..., 'z', ' ', '-', '&', 'ä', 'ö', 'ü'];

Please check this fiddle http://jsfiddle.net/F6Sq4/

The examples uses some german umlauts (äöü), but you might include any other char.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM