APEX-AT-WORK no image

Weird IE behaviour with JS function String.charAt(Index)

Von Tobias Arnhold 3.10.2010
I had a real pain with the MS Internet Explorer and the javascript function String.charAt(Index)

I wanted to update a string and checked each value. IE was able to give just an empty value back. But it was not checkable!

if ((v_browser=="Microsoft Internet Explorer")&& (v_string.charAt(x)=='')&& (y+1==x) && (v_string.charAt(x+1)=='<'||v_string.charAt(x+2)=='<'))

Even the length was 1 and not 0!
Finally I tried this function String.charCodeAt(Index) with an alert box and voilà two values where prompted: 13 and 10

13 and 10 wait... LINEBREAK!

HELL why does it do such things...

Now I could check it!

if ((v_browser=="Microsoft Internet Explorer")&&(v_check_unicode=='13'||v_check_unicode=='10'||v_check_unicode=='NaN'))

My script works and I feel released.
Now I have to watch the end of Real against Lyon.. :D

3 Comments " Weird IE behaviour with JS function String.charAt(Index) "

marry 30 March, 2010 08:36

Blogs are so informative where we get lots of information on any topic. Nice job keep it up!!

MBA Dissertation

dznqbit 03 May, 2010 02:35

why not the subscript[] operator?

MBA Dissertation 22 April, 2011 12:12

Weird IE behaviour with JS function <-- that's what i was looking for