开发者

jQuery split problem

开发者 https://www.devze.com 2023-03-03 22:28 出处:网络
I have a script, which returns value as an object. It can return text or numbers, like \'hello, goodbye\' or \'500, 900\'.

I have a script, which returns value as an object. It can return text or numbers, like 'hello, goodbye' or '500, 900'.

When I try to use split() with this object, I catch an error:

TypeError: Object 'hello, goodbye' has no method 'split'

But I want to use split. What开发者_开发技巧 can I do?

Seems the only way to convert this object into a string, how to do that?


does a = a+''; a.split('') work? that should convert the object to string before split is called.

0

精彩评论

暂无评论...
验证码 换一张
取 消