13 March 2009 0 comments JavaScript
This blog post is 13 years old! Most likely, its content is outdated. Especially if it's technical.
This murdered a good half hour of my time splattered with lots of alert()
statements to debug. Basically, in Firefox you can do this:
var word = "Peter";
alert(word[1]); // "e" in Firefox, undefined in IE
This is the wrong way to get to character in a string in Javascript. The correct way is to use charAt()
like this:
var word = "Peter";
alert(word.charAt(1)); // "e" in Firefox and IE
I don't know about the other browsers but finally Crosstips.org now works in IE7 too. I haven't even looked at it in IE6 and don't intend to either.
- Previous:
- Sandisk SSD v/s HDD 4 March 2009
- Next:
- Nginx vs. Squid 17 March 2009
- Related by category:
- How to "onchange" in ReactJS 21 October 2015 JavaScript
- To then() or to success() in AngularJS 27 November 2014 JavaScript
- How to throttle AND debounce an autocomplete input in React 1 March 2018 JavaScript
- How to create-react-app with Docker 17 November 2017 JavaScript
- Display current React version 7 January 2018 JavaScript
- Related by keyword:
- An example of using Immer to handle nested objects in React state 18 January 2019