PDA

View Full Version : JavaScript Split() Function: IE vs. Firefox



mdm-adph
20 Sep 2007, 12:57 PM
Okay, so what's the deal with the split function on IE?

If I have a tab-delimited list stored in a field (I'm later turning it into a data.Store), and I split each line with a Split() function, I get different results in IE and Firefox depending upon the delimiter string I use, if there are empty string values present. Example:

Delimited String: (value)\t(value)\t\t\t(value)

String.split("\t") in Firefox: [(value), (value), (empty), (empty), (value)]

String.split("\t") in IE: [(value), (value), (empty), (empty), (value)]

String.split(/\t/) in Firefox: [(value), (value), (empty), (empty), (value)]

String.split(/\t/) in IE: [(value), (value), (value)]

What am I missing, eh?

javascript
25 Sep 2009, 3:19 AM
You can find javascript examples on splitting text values at javascript split function (http://www.kodyaz.com/articles/javascript-string-split-function-example.aspx) examples titled post.
I hope that helps for the solution.