Hy,
I don’t really understand why my code isn’t working.
Short description:
I have implemented an auto suggest function on my own, like jquery-ui autosuggest. Unfortunately I can’t use jQuery UI and I had to stick with jQuery 1.3.1 due to system restrictions.
If the user enters letters like ‘ä’,’ö’,’ü’ and I try to check if those letters were inserted like so:
if(inputFieldText.indexOf('ä')!=-1){
alert("detection");
}
the page where I deployed this does not alert() but if I run this in a jsfiddle http://jsfiddle.net/nyDBB/4/ it works fine. Everything is placed within the Document ready block and other functionalities like .click(),.change() do work fine.
I have also tried to use the encode() methods but that’s not really a good way to work around and also gives me certain errors.
So my suggestion is that there is something wrong with setting the encoding on the page, but does anybody know how to get over this problem ?
Make sure everything is in UTF-8 (or any other encoding in fact).
That means both .js and .htm file has to have same charset.
For debug, you can try putting JS code into html document into
<script>tag. Then it should work, since encoding is garanteed the same.