Wednesday 21 August 2019

jquery - Splitting a key value pair response seperated by a '&' using Javascript







I have a response that I receive from the server in this format - Status=105&Accno=1458874455&Name=XYZ&Bal=5,888.00
Here '&' signifies separator.




I need to iterate through the string response and split this string in JavaScript based on the '&' and get the values and store them as :



Status=105
Accno=1458874455
Name=XYZ
Bal=5,888.00


so that I can populate them in the respective textbox and drop down.




I am using jQuery and AJAX for receiving the response.

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...