What is the best cross-browser practice to split spaces in a string with Javascript?
I tried theString.split(" ") but i am having issues with IE and Chrome/Safari.
Update
Here’s the js code. IE/Chrome throw error at line: 61
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To avoid having empty parts, split with the help of a regex:
Optionally, trim string before splitting.