¡@

Home 

2014/10/16 ¤W¤È 12:02:01

jquery Programming Glossary: asf

Convert URL parameters to a javascript object

http://stackoverflow.com/questions/8648892/convert-url-parameters-to-a-javascript-object

URL parameters to a javascript object I have a string like this abc foo def 5Basf 5D xyz 5 it comes from ajaxOptions.data parameter from the ajaxComplete event How can I convert it into a javascript object.. parameter from the ajaxComplete event How can I convert it into a javascript object like this obj abc 'foo' def ' asf ' xyz 5 javascript jquery json object share improve this question Edit This edit improves and explains the answer.. 1 JSON.parse ' ' decodeURI search .replace g ' ' .replace g ' ' .replace g ' ' ' ' Example Parse abc foo def 5Basf 5D xyz 5 in five steps decodeURI abc foo def asf xyz 5 Escape quotes same as there are no quotes Replace abc foo def asf..