Here’s a quick note on mobile browsers like Android, WebKit. Based on my testing, it seems that string trim() function is not supported.
I was trying to do something like:
That won’t work in mobile browsers for some reason but you can do something like it using match instead:
I don’t know exactly why trim() isn’t supported fully on mobile browsers but for those of you who have problems with your website that works on desktop browsers but not on mobile ones, this could possibly be your solution.
For the weirdest reasons, trim() function breaks everything in Android and WebKit. Don’t ask me why, just don’t use it. Of course, it’s probably not the most efficient function anyways. Instead use match() to match whatever you need.