javascript - string.split not working as intended in Firefox? Works fine in Chrome -
having bit of issue here. have code:
//phonenumber string ie ('01☂916☂5234321') var phonenumbersplit = phonenumber.split('☂'); console.log(phonenumbersplit); //in chrome returns ["01", "916", "5234321"], in firefox returns //[ "01☂916☂5234321" ]
i later call phonenumbersplit[1]
in chrome fine, in firefox says it's undefined
. why string.split
return 2 different things depending on browser i'm in? documentation says works in both firefox , chrome. help?
edit oooook figure out issue was. on page testing on charset="utf-8"
missing meta tag , wasn't reading unicode character. in chrome guess have utf-8 on default , in firefox not, or something. whoops.
i figured out issue was. on page testing on charset="utf-8"
missing meta tag , wasn't reading unicode character. in chrome guess have utf-8 on default , in firefox not, or something. whoops.
Comments
Post a Comment