Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有什么方法可以转换"["item1","item2"]"为["item1","item2"]javascript 或 jQuery 吗?
"["item1","item2"]"
["item1","item2"]
JSON.parse('["item1","item2"]');
或者如果你真的需要它来支持较低的 IE:
$.parseJSON('["item1","item2"]');
您可以使用replace(),
现场演示
str = str.replace('"[', '[').replace(']"' , ']');